@@ -382,32 +382,18 @@ class RF24
382
382
* radio.writeFast(&buf,32);
383
383
* radio.writeFast(&buf,32);
384
384
* radio.writeFast(&buf,32); //Fills the FIFO buffers up
385
- * while( !txStandBy() ){} //Waits for TX complete or timeout
385
+ * bool ok = txStandBy(0); //Returns 0 if failed. 1 if success.
386
+ * //Blocks only until timeout or success. Data flushed on fail.
387
+ *
388
+ * Using txStandBy(1) will not return until the data is transmitted. It will never return 0.
386
389
*
387
390
* @endcode
388
391
*
389
- * @return True if transmission is finished and the radio has been commanded
390
- * to enter STANDBY-I operating mode.
392
+ * @return True if transmission is successful
391
393
*
392
394
*/
393
395
bool txStandBy ();
394
-
395
- /* *
396
- * Optimization: New Command
397
- *
398
- * This function is mainly used internally to take advantage of the auto payload
399
- * re-use functionality of the chip, but can be beneficial to users as well.
400
- *
401
- * The function will instruct the radio to re-use the data in the FIFO buffers,
402
- * and instructs the radio to re-send once the timeout limit has been reached.
403
- * Used by writeFast and writeBlocking to initiate retries when a TX failure
404
- * occurs. Retries are automatically initiated except with the standard write().
405
- * This way, data is not flushed from the buffer until switching between modes.
406
- *
407
- * @note This is to be used AFTER auto-retry fails if wanting to resend
408
- * using the built-in payload reuse features.
409
- */
410
- void reUseTX ();
396
+ bool txStandBy (bool block);
411
397
412
398
/* *
413
399
* Test whether there are bytes available to be read
@@ -689,19 +675,6 @@ class RF24
689
675
*/
690
676
void powerUp (void ) ;
691
677
692
- /* *
693
- * Test whether there are bytes available to be read in the
694
- * FIFO buffers. This optimized version does not rely on interrupt
695
- * flags, but checks the actual FIFO buffers.
696
- *
697
- * @note Optimization: Interrupt flags are no longer cleared when available is called,
698
- * but will be reset only when the data is read from the FIFO buffers.
699
- *
700
- * @param[out] pipe_num Which pipe has the payload available
701
- * @return True if there is a payload available, false if none is
702
- */
703
- bool available (uint8_t * pipe_num);
704
-
705
678
/* *
706
679
* Non-blocking write to the open writing pipe
707
680
*
@@ -721,6 +694,23 @@ class RF24
721
694
*/
722
695
void startWrite ( const void * buf, uint8_t len );
723
696
697
+ /* *
698
+ * Optimization: New Command
699
+ *
700
+ * This function is mainly used internally to take advantage of the auto payload
701
+ * re-use functionality of the chip, but can be beneficial to users as well.
702
+ *
703
+ * The function will instruct the radio to re-use the data in the FIFO buffers,
704
+ * and instructs the radio to re-send once the timeout limit has been reached.
705
+ * Used by writeFast and writeBlocking to initiate retries when a TX failure
706
+ * occurs. Retries are automatically initiated except with the standard write().
707
+ * This way, data is not flushed from the buffer until switching between modes.
708
+ *
709
+ * @note This is to be used AFTER auto-retry fails if wanting to resend
710
+ * using the built-in payload reuse features.
711
+ */
712
+ void reUseTX ();
713
+
724
714
/* *
725
715
* Write an ack payload for the specified pipe
726
716
*
@@ -751,6 +741,19 @@ class RF24
751
741
*/
752
742
bool isAckPayloadAvailable (void );
753
743
744
+ /* *
745
+ * Test whether there are bytes available to be read in the
746
+ * FIFO buffers. This optimized version does not rely on interrupt
747
+ * flags, but checks the actual FIFO buffers.
748
+ *
749
+ * @note Optimization: Interrupt flags are no longer cleared when available is called,
750
+ * but will be reset only when the data is read from the FIFO buffers.
751
+ *
752
+ * @param[out] pipe_num Which pipe has the payload available
753
+ * @return True if there is a payload available, false if none is
754
+ */
755
+ bool available (uint8_t * pipe_num);
756
+
754
757
/* *
755
758
* Call this when you get an interrupt to find out why
756
759
*
0 commit comments