Skip to content

Commit d4c598e

Browse files
authored
Add delay during fragmentation for nRF52x (#253)
* Add delay during fragmentation for nRF52x - nRF52x is slightly faster than nRF24, make up for this with a delay while sending fragmented payloads #252 * Add docs comments for THROTTLE_FRAG
1 parent aed6024 commit d4c598e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

RF24Network.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,9 @@ bool ESBNetwork<radio_t>::main_write(RF24NetworkHeader& header, const void* mess
788788
retriesPerFrag = 0;
789789
fragment_id--;
790790
msgCount++;
791+
#if THROTTLE_FRAG > 0
792+
delayMicroseconds(THROTTLE_FRAG);
793+
#endif
791794
}
792795

793796
//if(writeDirect != NETWORK_AUTO_ROUTING){ delay(2); } //Delay 2ms between sending multicast payloads

RF24Network_config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
*/
4141
#define NUM_PIPES 6
4242

43+
/**
44+
* Add a slight delay (63 uS) when sending fragmented payloads with nRF52x & nrf_to_nrf library
45+
* This is required because the nRF52x is slightly faster than the nRF24L01
46+
*/
47+
#ifndef THROTTLE_FRAG
48+
#ifdef NRF52_RADIO_LIBRARY
49+
#define THROTTLE_FRAG 63
50+
#else
51+
#define THROTTLE_FRAG 0
52+
#endif
53+
#endif
54+
4355
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
4456

4557
/********** USER CONFIG - non ATTiny **************/

0 commit comments

Comments
 (0)