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:
Jeff Wang
2019-05-02 03:27:01 -04:00
parent 6399cbf44f
commit 0049f3df98
15 changed files with 121 additions and 104 deletions

View File

@ -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;