diff options
author | Keith Packard <keithp@keithp.com> | 2012-05-26 21:01:46 -0600 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-05-26 21:01:46 -0600 |
commit | 19b23594a04fc72fd7d2e106c5877b670662001d (patch) | |
tree | e4f3e1d386690cf226e2bfeac0edba638d5044bb | |
parent | 0beebf5b8659014c5e8ba194e42e5dcd9be1a2a6 (diff) |
avr: Block interrupts while executing SPI slave codetelescience
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>
-rw-r--r-- | src-avr/ao_spi_slave.c | 4 |
1 files changed, 1 insertions, 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(); |