@@ -448,7 +448,7 @@ void RF24::powerUp(void)
448
448
bool RF24::write ( const void * buf, uint8_t len )
449
449
{
450
450
// Start Writing
451
- startWrite (buf,len);
451
+ startFastWrite (buf,len);
452
452
453
453
// Wait until complete or failed
454
454
// ACK payloads that are handled improperly will cause this to hang
@@ -487,7 +487,7 @@ bool RF24::writeBlocking( const void* buf, uint8_t len )
487
487
488
488
}
489
489
// Start Writing
490
- startWrite (buf,len);
490
+ startFastWrite (buf,len);
491
491
492
492
return 1 ;
493
493
}
@@ -525,7 +525,7 @@ bool RF24::writeFast( const void* buf, uint8_t len )
525
525
526
526
}
527
527
// Start Writing
528
- startWrite (buf,len);
528
+ startFastWrite (buf,len);
529
529
530
530
return 1 ;
531
531
}
@@ -539,14 +539,32 @@ bool RF24::writeFast( const void* buf, uint8_t len )
539
539
// Otherwise we enter Standby-II mode, which is still faster than standby mode
540
540
// Also, we remove the need to keep writing the config register over and over and delaying for 150 us each time if sending a stream of data
541
541
542
- void RF24::startWrite ( const void * buf, uint8_t len ){ // TMRh20
542
+ void RF24::startFastWrite ( const void * buf, uint8_t len ){ // TMRh20
543
543
544
544
write_payload ( buf,len);
545
545
ce (HIGH);
546
546
547
547
}
548
548
549
549
550
+ // Added the original startWrite back in so users can still use interrupts, ack payloads, etc
551
+ // Allows the library to pass all tests
552
+ void RF24::startWrite ( const void * buf, uint8_t len )
553
+ {
554
+ // Transmitter power-up
555
+ write_register (CONFIG, ( read_register (CONFIG) | _BV (PWR_UP) ) & ~_BV (PRIM_RX) );
556
+ delayMicroseconds (150 );
557
+
558
+ // Send the payload
559
+ write_payload ( buf, len );
560
+
561
+ // Allons!
562
+ ce (HIGH);
563
+ delayMicroseconds (15 );
564
+ ce (LOW);
565
+ }
566
+
567
+
550
568
bool RF24::txStandBy (){
551
569
552
570
if ( (read_register (FIFO_STATUS) & _BV (TX_EMPTY))){
@@ -613,7 +631,7 @@ void RF24::read( void* buf, uint8_t len ){
613
631
read_payload ( buf, len );
614
632
615
633
// Clear the two possible interrupt flags with one command
616
- write_register (STATUS,_BV (RX_DR) | _BV (TX_DS) );
634
+ write_register (STATUS,_BV (RX_DR) | _BV (MAX_RT) | _BV ( TX_DS) );
617
635
618
636
}
619
637
0 commit comments