Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: JNP3_IOT_6_RADIO_ECHO_FIXED2_2
Diff: nRF24L01P.cpp
- Revision:
- 2:3012f09dfcc2
- Parent:
- 1:781a7eef8610
- Child:
- 3:3f6bf32d36c2
- Child:
- 4:d1c0020f1c87
--- a/nRF24L01P.cpp Tue Nov 15 15:47:58 2016 +0000 +++ b/nRF24L01P.cpp Wed Jan 04 10:58:27 2017 +0000 @@ -190,8 +190,22 @@ wait_us(_NRF24L01P_TIMING_Tundef2pd_us); // Wait for Power-on reset setRegister(_NRF24L01P_REG_CONFIG, 0); // Power Down + + // Wait until the nRF24L01+ powers down + wait_us( _NRF24L01P_TIMING_Tpd2stby_us ); // This *may* not be necessary (no timing is shown in the Datasheet), but just to be safe setRegister(_NRF24L01P_REG_STATUS, _NRF24L01P_STATUS_MAX_RT|_NRF24L01P_STATUS_TX_DS|_NRF24L01P_STATUS_RX_DR); // Clear any pending interrupts + + //flush FIFO + nCS_ = 0; + spi_.write(_NRF24L01P_SPI_CMD_FLUSH_TX); + nCS_ = 1; + wait_us( _NRF24L01P_TIMING_Tpece2csn_us ); + nCS_ = 0; + spi_.write(_NRF24L01P_SPI_CMD_FLUSH_RX); + nCS_ = 1; + wait_us( _NRF24L01P_TIMING_Tpece2csn_us ); + // // Setup default configuration