avr: Block interrupts while executing SPI slave code
[fw/altos] / src-avr / ao_spi_slave.c
index 9ef30ead7d19cab604b35ee8ff1e02e02ac5fcf0..a524f31fcb1c87cc757c702652dac15e714491cb 100644 (file)
@@ -84,15 +84,13 @@ static uint8_t ao_spi_slave_recv(void)
 
 static uint8_t ao_spi_slave_running;
 
-ISR(PCINT0_vect)
+ISR(PCINT0_vect, ISR_BLOCK)
 {
        if ((PINB & (1 << PINB0)) == 0) {
                if (!ao_spi_slave_running) {
                        uint8_t changed;
                        ao_spi_slave_running = 1;
-                       cli();
                        changed = ao_spi_slave_recv();
-                       sei();
                        if (changed && ao_flight_boost <= ao_log_store.tm_state) {
                                if (ao_log_store.tm_state < ao_flight_landed)
                                        ao_log_start();