avr: Block interrupts while executing SPI slave code telescience
authorKeith Packard <keithp@keithp.com>
Sun, 27 May 2012 03:01:46 +0000 (21:01 -0600)
committerKeith Packard <keithp@keithp.com>
Sun, 27 May 2012 03:01:46 +0000 (21:01 -0600)
Any interrupts do very bad things to our SPI reliability. Block
interrupts for the whole of the SPI slave ISR.

Signed-off-by: Keith Packard <keithp@keithp.com>
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();