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 c695a72..2be4abe 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