Skip to content

Commit

Permalink
Make RF24_POWERUP_DELAY configurable in RF24_config.h (#690)
Browse files Browse the repository at this point in the history
* available() could be slightly faster #631

* allow skipping delay(5) in powerUp()

* allow skipping delay(5) in powerUp()

* Revert "allow skipping delay(5) in powerUp()"

This reverts commit ffd7524.

* Revert "allow skipping delay(5) in powerUp()"

This reverts commit ffd7524.

* add RF24_POWERUP_DELAY_MS to RF24_config.h

* delayMicroseconds()

* update doc comment
  • Loading branch information
jscrane authored Nov 29, 2020
1 parent a0cd707 commit 8b2f2a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ void RF24::powerUp(void)
// For nRF24L01+ to go from power down mode to TX or RX mode it must first pass through stand-by mode.
// There must be a delay of Tpd2stby (see Table 16.) after the nRF24L01+ leaves power down mode before
// the CEis set high. - Tpd2stby can be up to 5ms per the 1.0 datasheet
delay(5);
delayMicroseconds(RF24_POWERUP_DELAY);
}
}

Expand Down
13 changes: 11 additions & 2 deletions RF24_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
#ifndef __RF24_CONFIG_H__
#define __RF24_CONFIG_H__

/*** USER DEFINES: ***/
/*** USER DEFINES: ***/
#define FAILURE_HANDLING
//#define SERIAL_DEBUG
//#define MINIMAL
//#define SPI_UART // Requires library from https://github.com/TMRh20/Sketches/tree/master/SPI_UART
//#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO


/**
* User access to internally used delay time (in microseconds) during RF24::powerUp()
* @warning This default value compensates for all supported hardware. Only adjust this if you
* know your radio's hardware is, in fact, genuine and reliable.
*/
#if !defined(RF24_POWERUP_DELAY)
#define RF24_POWERUP_DELAY 5000
#endif

/**********************/
#define rf24_max(a,b) (a>b?a:b)
#define rf24_min(a,b) (a<b?a:b)
Expand Down

0 comments on commit 8b2f2a9

Please sign in to comment.