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:
- 8:f8621be17645
- Parent:
- 7:434a1c2ff406
- Child:
- 9:1440769ba2f9
diff -r 434a1c2ff406 -r f8621be17645 nRF24L01P.cpp --- a/nRF24L01P.cpp Sun Nov 12 18:53:35 2017 +0000 +++ b/nRF24L01P.cpp Mon Nov 13 08:38:39 2017 +0000 @@ -220,6 +220,8 @@ disableAutoAcknowledge(); disableAutoRetransmit(); setTransferSize(); + + a_retr_enabled = true; mode = _NRF24L01P_MODE_POWER_DOWN; @@ -566,6 +568,7 @@ void nRF24L01P::disableAutoRetransmit(void) { setRegister(_NRF24L01P_REG_SETUP_RETR, _NRF24L01P_SETUP_RETR_NONE); + a_retr_enabled = false; } @@ -574,6 +577,7 @@ count = (0x000F & count); setRegister(_NRF24L01P_REG_SETUP_RETR, delay|count); + a_retr_enabled = true; } @@ -906,6 +910,7 @@ // Clear the Status bit setRegister(_NRF24L01P_REG_STATUS, _NRF24L01P_STATUS_TX_DS); + setRegister(_NRF24L01P_REG_STATUS, _NRF24L01P_STATUS_MAX_RT); nCS_ = 0; @@ -927,10 +932,12 @@ disable(); while ( !( getStatusRegister() & (_NRF24L01P_STATUS_TX_DS | _NRF24L01P_STATUS_MAX_RT) ) ) { - } - if(getStatusRegister() & _NRF24L01P_STATUS_MAX_RT){ + int s = getStatusRegister(); + + if (s & _NRF24L01P_STATUS_MAX_RT){ + //max retransmissions flushTx(); count = -1; }