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 b742d29aa6de10b73bb6d1ce8e60f756c0d7fc3f..a400b8a0a929f0485b8d8da894f43c17ec098f79 100644 (file)
@@ -44,9 +44,8 @@ ao_spi_slave_send(uint8_t *buf, uint8_t len)
 
 static uint8_t ao_spi_slave_running;
 
 
 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
 #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;
        }
        } else {
                ao_spi_slave_running = 0;
        }
-       sei();
 }
 
 void
 }
 
 void