From 19b23594a04fc72fd7d2e106c5877b670662001d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 26 May 2012 21:01:46 -0600 Subject: [PATCH] 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 --- src-avr/ao_spi_slave.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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(); -- 2.30.2