X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fvend.h;h=17ba674d1fd88c2deee12ec3b8692bde5283c997;hb=47ccc4dcb3e35d80f402793e3715e4a6166b3629;hp=9922719163156393f33e6155658e632e3d37c4a1;hpb=41ad37ba6d86ccc4f8f720cb09f7891ae166cb38;p=uccvend-snackrom.git diff --git a/ROM2/vend.h b/ROM2/vend.h index 9922719..17ba674 100644 --- a/ROM2/vend.h +++ b/ROM2/vend.h @@ -10,27 +10,26 @@ * with buffered_addr, and also in LDFLAGS in the Makefile */ #define buffered_addr(a) \ - extern volatile u8* _##a; \ - u8 a; \ - extern inline void set_##a(u8 b) { a = *_##a = b; } \ - extern inline void bset_##a(const u8 m) { bset(&a, m); *_##a = a; } \ - extern inline void bclr_##a(const u8 m) { bclr(&a, m); *_##a = a; } + extern volatile u8 _##a; \ + volatile u8 a; \ + extern inline void set_##a(u8 b) { a = b; _##a = b; } \ + extern inline void bset_##a(const u8 m) { bset((void*)&a, m); _##a = a; } \ + extern inline void bclr_##a(const u8 m) { bclr((void*)&a, m); _##a = a; } buffered_addr(changer_output); buffered_addr(misc_output); -extern volatile u8* _switch_input; -#define switch_input (*_switch_input) -extern volatile u8* _misc_input; -#define misc_input (*_misc_input) -extern volatile u8* _home_sensors; -#define home_sensors (*_home_sensors) +extern volatile u8 _switch_input; +#define switch_input _switch_input +extern volatile u8 _misc_input; +#define misc_input _misc_input +extern volatile u8 _home_sensors; +#define home_sensors _home_sensors extern u16 _stack; /******* from helpers.c *******/ void delay(u16 ms); -void print_amount(u16 amt); void my_strncpy(char* dst, char* src, u8 max_size); /* for null-term strings */ void my_memcpy(char* dst, char* src, u8 size); @@ -42,7 +41,7 @@ void my_memcpy(char* dst, char* src, u8 size); #define PORTD_KEYPAD_ROW 0x20 /* clear for row 0, set for row 1 */ -#define PORTE_MOTOR_OVERCURRENT 0x01 +#define PORTE_MOTOR_NOT_OVERCURRENT 0x01 #define PORTE_MOTOR_OVERVOLTAGE 0x02 /* Address 1800 bits */ @@ -52,7 +51,8 @@ void my_memcpy(char* dst, char* src, u8 size); #define A3000_MOTOR_ROW_DISABLE 0x80 /* Address 3800 bits */ -#define A3800_DISPLAY_WRITE 0x04 +#define A3800_KEYPAD_STROBE 0x04 +#define A3800_DISPLAY_WRITE 0x08 #define A3800_MOTOR_DATA 0x10 #define A3800_MOTOR_COL8_ENABLE 0x20 #define A3800_MOTOR_COL9_ENABLE 0x40 @@ -60,7 +60,8 @@ void my_memcpy(char* dst, char* src, u8 size); /******* from main.c *******/ int __attribute__((noreturn)) main (void); void __attribute__((interrupt)) rti (void); -void __attribute__((interrupt)) sci_interrupt (void); +void __attribute__((interrupt)) sci_interrupt_serial (void); +void __attribute__((interrupt)) sci_interrupt_coinmech (void); void __attribute__((interrupt)) uart_interrupt (void); /* other one liners */