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);
}
/******************************************************************/