Fix: Due write() issues.

Found that Due would send multiple payloads or fail in writing in some
cases. Change ensures single-payload transmission using write().
- Updated pingpair_dyn.ino example sketch to conform with available()
changes
- Slight doc update
This commit is contained in:
TMRh20
2014-04-07 20:41:38 -06:00
parent d28323aadc
commit afdb084daf
3 changed files with 44 additions and 14 deletions
+1 -3
View File
@@ -579,15 +579,13 @@ void RF24::powerUp(void)
bool RF24::write( const void* buf, uint8_t len )
{
//Start Writing
startFastWrite(buf,len);
startWrite(buf,len);
//Wait until complete or failed
//ACK payloads that are handled improperly will cause this to hang
//If autoAck is ON, a payload has to be written prior to reading a payload, else write after reading a payload
while( ! ( get_status() & ( _BV(TX_DS) | _BV(MAX_RT) ))) { }
ce(LOW); //Set the radio back to STANDBY-I mode since we can only fill one buffer at a time using this method, and tx is complete
uint8_t status = write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );
//Max retries exceeded