Skip to content

Commit

Permalink
allow skipping delay(5) in powerUp()
Browse files Browse the repository at this point in the history
  • Loading branch information
jscrane committed Nov 27, 2020
1 parent a0cd707 commit ffd7524
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ void RF24::powerDown(void)
/****************************************************************************/

//Power up now. Radio will not power down unless instructed by MCU for config changes etc.
void RF24::powerUp(void)
void RF24::powerUp(bool wait)
{
// if not powered up then power up and wait for the radio to initialize
if (!(config_reg & _BV(PWR_UP))) {
Expand All @@ -765,7 +765,8 @@ 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);
if (wait)
delay(5);
}
}

Expand Down
2 changes: 1 addition & 1 deletion RF24.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class RF24 {
* To return to low power mode, call powerDown().
* @note This will take up to 5ms for maximum compatibility
*/
void powerUp(void);
void powerUp(bool wait = true);

/**
* Write for single NOACK writes. Optionally disables acknowledgements/autoretries for a single write.
Expand Down

0 comments on commit ffd7524

Please sign in to comment.