altos: Add ao_arch_block/release_interrupts to avr and cc1111
[fw/altos] / src / avr / ao_arch.h
index 0ed97361bb34da7b8be023b91b28b8f6c0b80ad2..c82612a8ca12bf98666cc7f2970b147229ca6657 100644 (file)
@@ -37,7 +37,9 @@
  * AVR definitions and code fragments for AltOS
  */
 
-#define AO_STACK_SIZE  128
+#ifndef AO_STACK_SIZE
+#define AO_STACK_SIZE  116
+#endif
 
 /* Various definitions to make GCC look more like SDCC */
 
@@ -67,7 +69,11 @@ extern void putchar(char c);
 extern char getchar(void);
 extern void ao_avr_stdio_init(void);
 
-extern const uint16_t ao_serial_number;
+#define AO_ROMCONFIG_VERSION   2
+
+#define AO_ROMCONFIG_SYMBOL(a) const
+
+extern AO_ROMCONFIG_SYMBOL(0) uint16_t ao_serial_number;
 
 #define AVR_PUSH8(stack, val)  (*((stack)--) = (val))
 
@@ -105,7 +111,6 @@ extern uint8_t      ao_cpu_sleep_disable;
                asm("push r14" "\n\t" "push r13" "\n\t" "push r12" "\n\t" "push r11" "\n\t" "push r10"); \
                asm("push r9" "\n\t" "push r8" "\n\t" "push r7" "\n\t" "push r6" "\n\t" "push r5"); \
                asm("push r4" "\n\t" "push r3" "\n\t" "push r2" "\n\t" "push r1" "\n\t" "push r0"); \
-               cli();                                                  \
                asm("in r0, __SREG__" "\n\t" "push r0");                \
                sei();                                                  \
        } while (0)
@@ -143,7 +148,12 @@ extern uint8_t     ao_cpu_sleep_disable;
                asm("ret");                                             \
        } while(0)
 
-#define ao_arch_critical(b) do { cli(); b; sei(); } while (0)
+#define ao_arch_critical(b) do { cli(); do { b } while (0); sei(); } while (0)
+
+#define ao_arch_block_interrupts()     cli()
+#define ao_arch_release_interrupts()   sei()
+
+#define AO_TELESCIENCE_NUM_ADC 12
 
 #endif /* _AO_ARCH_H_ */