altos/avr: Use ISR_BLOCK to disable interrupts during slave ISR
authorKeith Packard <keithp@keithp.com>
Wed, 17 Oct 2012 04:08:58 +0000 (21:08 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 17 Oct 2012 04:08:58 +0000 (21:08 -0700)
This avoids enabling and then immediatly disabling them

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

index b742d29..a400b8a 100644 (file)
@@ -44,9 +44,8 @@ ao_spi_slave_send(uint8_t *buf, uint8_t len)
 
 static uint8_t ao_spi_slave_running;
 
-ISR(PCINT0_vect)
+ISR(PCINT0_vect, ISR_BLOCK)
 {
-       cli();
 #if SPI_SLAVE_PIN_0_3
        if ((PINB & (1 << PORTB0)) == 0)
 #endif
@@ -61,7 +60,6 @@ ISR(PCINT0_vect)
        } else {
                ao_spi_slave_running = 0;
        }
-       sei();
 }
 
 void