From: Keith Packard Date: Sun, 27 May 2012 03:01:46 +0000 (-0600) Subject: avr: Block interrupts while executing SPI slave code X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=19b23594a04fc72fd7d2e106c5877b670662001d avr: Block interrupts while executing SPI slave code 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 --- diff --git a/src-avr/ao_spi_slave.c b/src-avr/ao_spi_slave.c index 9ef30ead..a524f31f 100644 --- a/src-avr/ao_spi_slave.c +++ b/src-avr/ao_spi_slave.c @@ -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();