Don't disable interrupts before saving interrupt flag on AVR
authorKeith Packard <keithp@keithp.com>
Mon, 19 Mar 2012 18:24:43 +0000 (11:24 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 29 Mar 2012 04:37:03 +0000 (21:37 -0700)
This ignores the interrupt disabled state, so we'd always leave
ao_yield with interrupts disabled.

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

index c189ccba08438d825348e874749917552520abb3..b816279e29f540f14a49f63f41083365ee051f45 100644 (file)
@@ -105,7 +105,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)