Lots of changes! Takes us to rom S
[uccvend-snackrom.git] / ROM2 / vend.h
index 11c483d..460aa71 100644 (file)
  */
 #define buffered_addr(a) \
        extern volatile u8 _##a;          \
-       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(&a, m); \
-               asm volatile ( "ldab %1\nstab %0\n" \
-                               : "=m"(_##a) : "m"(a) : "d"); } \
-       extern inline void bclr_##a(const u8 m) { \
-               bclr(&a, m); \
-               asm volatile ( "ldab %1\nstab %0\n" \
-                               : "=m"(_##a) : "m"(a) : "d"); }
+       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);
@@ -32,11 +26,14 @@ extern volatile u8 _misc_input;
 extern volatile u8 _home_sensors;
 #define home_sensors _home_sensors
 
+#define is_standalone() (misc_input & 0x01) /* DIP sw 1 */
+
 extern u16 _stack;
 
 /******* from helpers.c *******/
 void delay(u16 ms);
 void my_strncpy(char* dst, char* src, u8 max_size); /* for null-term strings */
+bool my_strncmp(char* a, char* b, u8 len);
 void my_memcpy(char* dst, char* src, u8 size);
 
 /******** Some meaningful bits ******/
@@ -47,7 +44,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 */
@@ -66,7 +63,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 */

UCC git Repository :: git.ucc.asn.au