cc1200: read out any pending packet before turning off

This commit is contained in:
Simon Duquennoy 2018-10-03 14:15:25 +02:00
parent f4c1ae0fdd
commit 90264a3ba3
1 changed files with 10 additions and 0 deletions

View File

@ -1098,6 +1098,16 @@ off(void)
idle();
if(single_read(CC1200_NUM_RXBYTES) > 0) {
RELEASE_SPI();
/* In case there is something in the Rx FIFO, read it */
cc1200_rx_interrupt();
if(SPI_IS_LOCKED()) {
return 0;
}
LOCK_SPI();
}
/*
* As we use GPIO as CHIP_RDYn signal on wake-up / on(),
* we re-configure it for CHIP_RDYn.