summaryrefslogtreecommitdiffstats
path: root/lock
diff options
context:
space:
mode:
Diffstat (limited to 'lock')
-rw-r--r--lock/nrfm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lock/nrfm.c b/lock/nrfm.c
index dd83f47..560609c 100644
--- a/lock/nrfm.c
+++ b/lock/nrfm.c
@@ -148,6 +148,8 @@ static inline void flush_tx(void)
while (!(SPSR & (1 << SPIF)))
;
SPI_PORT |= (1 << SPI_SS);
+
+ reset_irqs();
}
static inline void flush_rx(void)
@@ -157,6 +159,8 @@ static inline void flush_rx(void)
while (!(SPSR & (1 << SPIF)))
;
SPI_PORT |= (1 << SPI_SS);
+
+ reset_irqs();
}
static inline uint8_t rx_pdlen(void)
@@ -243,7 +247,6 @@ uint8_t radio_sendto(
tx_mode();
flush_tx();
- reset_irqs();
setaddr(0x10, addr);
setaddr(0x0A, addr);
@@ -302,7 +305,6 @@ uint8_t radio_recv(char *buf, uint8_t n)
pdlen = rx_pdlen();
if (pdlen == 0) {
flush_rx();
- reset_irqs();
uart_write_line("ERROR: PDLEN = 0, abort read");
return 0;
}
@@ -313,7 +315,6 @@ uint8_t radio_recv(char *buf, uint8_t n)
if (pdlen > MAXPDLEN) {
flush_rx();
- reset_irqs();
uart_write_line("ERROR: PDLEN > MAXPDLEN, abort read");
return 0;
}
@@ -333,9 +334,7 @@ uint8_t radio_recv(char *buf, uint8_t n)
SPI_PORT |= (1 << SPI_SS);
flush_rx();
- reset_irqs();
enable_chip();
-
return readlen - 1;
}