altos/avr: Make ao_arch_critical argument be a statement
authorKeith Packard <keithp@keithp.com>
Tue, 11 Oct 2011 23:39:35 +0000 (17:39 -0600)
committerKeith Packard <keithp@keithp.com>
Tue, 11 Oct 2011 23:39:35 +0000 (17:39 -0600)
Wrap the argument to ao_arch_critical in do { } while (0); to make
sure it gets correctly checked as a statement.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/avr/ao_arch.h

index c695a725669bf2e64bf77f49d31088f779fc3676..2be4abeece26db527dd25b6ccbd9193d139e7b2b 100644 (file)
@@ -143,7 +143,7 @@ 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_TELESCIENCE_NUM_ADC 12