Inspired idea to change TX standby code

Realised that data would be lost if dropping to standby or power down
mode before the FIFO is empty.
txStandby now returns a boolean value to indicate whether the
transmission is complete. If there is data in the TX FIFO the radio will
not drop out of TX mode. eg: while(  !txStandBy()  ){}
This commit is contained in:
TMRh20
2014-03-19 08:26:59 -06:00
parent 77b1e2c140
commit 1e2f41c3f8
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -545,8 +545,13 @@ void RF24::startWrite( const void* buf, uint8_t len ){ //TMRh20
}
void RF24::txStandBy(){
ce(LOW);
bool RF24::txStandBy(){
if ( (read_register(FIFO_STATUS) & _BV(TX_EMPTY))){
ce(LOW);
return 1;
}
return 0;
}
/****************************************************************************/