do not compile with stack auto, change functions to be nonreentrant, use fixed parameters
- frees up ~4KB of code space
This commit is contained in:
17
src/key.h
17
src/key.h
@ -12,10 +12,23 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
//#define DEBUG_KEYS
|
||||
|
||||
void KeyInit(void);
|
||||
void KeyScan(void);
|
||||
|
||||
#pragma nooverlay
|
||||
void raw_scan(void) __using(1);
|
||||
|
||||
#pragma nooverlay
|
||||
void debounce(void) __using(1);
|
||||
|
||||
|
||||
#define KeyScan() do { \
|
||||
raw_scan(); \
|
||||
debounce(); \
|
||||
} while(0);
|
||||
|
||||
#ifdef DEBUG_KEYS
|
||||
const uint8_t* DebugGetKeys(void);
|
||||
@ -24,7 +37,7 @@ const uint8_t* DebugGetKeys(void);
|
||||
//definition included for determining if multiple keys are pressed
|
||||
//prefer using GetNewKeys();
|
||||
#define TOTAL_ROWS 5
|
||||
extern uint8_t Keys[TOTAL_ROWS]; //only bottom nibbles get set
|
||||
extern __idata uint8_t Keys[TOTAL_ROWS]; //only bottom nibbles get set
|
||||
extern int8_t NewKeyPressed;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user