Add powerUp to begin(), increase powerUp delay

- Found I could create a hang condition on startup with some code.
a: Now power up the radio on begin() to simplify things
b: Increase delay to 5ms for powerUp, although it should only take 2ms
tops, this prevents the hanging condition.
This commit is contained in:
TMRh20
2014-04-02 22:08:29 -06:00
parent 2f7e4489ba
commit 3455e489f4
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -399,6 +399,8 @@ void RF24::begin(void)
flush_rx();
flush_tx();
powerUp();
delay(5);
//Enable PTX, do not write CE high so radio will remain in standby I mode ( 130us max to transition to RX or TX instead of 1500us from powerUp )
write_register(CONFIG, ( read_register(CONFIG) ) & ~_BV(PRIM_RX) );
@@ -449,7 +451,7 @@ void RF24::powerDown(void)
void RF24::powerUp(void)
{
write_register(CONFIG,read_register(CONFIG) | _BV(PWR_UP));
delay(2);
delay(5);
}
/******************************************************************/
+2 -1
View File
@@ -996,6 +996,7 @@ private:
* - Changes to read() functionality have increased reliability and response
* - Extended timeout periods have been added to aid in noisy or otherwise unreliable environments
* - Delays have been removed where possible to ensure maximum efficiency
* - Untested: Arduino Due and ATTiny 84/85 support: Do NOT #include <SPI.h> with ATTiny.
* - More! See the links below and class documentation for more info.
*
* If issues are discovered with the documentation, please report them here: <a href="https://github.com/TMRh20/tmrh20.github.io/issues"> here</a>
@@ -1025,5 +1026,5 @@ private:
*/
#endif // __RF24_H__
// vim:ai:cin:sts=2 sw=2 ft=cpp