Created a non-blocking write and an example for how to use it.

This commit is contained in:
maniacbug
2011-07-06 20:49:59 -07:00
parent bb37e88094
commit d3fff68a7c
3 changed files with 102 additions and 31 deletions

18
RF24.h
View File

@@ -252,9 +252,6 @@ public:
* getPayloadSize(). However, you can write less, and the remainder
* will just be filled with zeroes.
*
* @todo Write a non-blocking write to support users who want to
* check on progress separately or use an interrupt.
*
* @param buf Pointer to the data to be sent
* @param len Number of bytes to be sent
* @return True if the payload was delivered successfully false if not
@@ -403,6 +400,21 @@ public:
*/
boolean available(uint8_t* pipe_num);
/**
* Non-blocking write to the open writing pipe
*
* Just like write(), but it returns immediately. To find out what happened
* to the send, catch the IRQ and then call whatHappened().
*
* @see write()
* @see whatHappened()
*
* @param buf Pointer to the data to be sent
* @param len Number of bytes to be sent
* @return True if the payload was delivered successfully false if not
*/
void startWrite( const void* buf, uint8_t len );
/**
* Enable custom payloads on the acknowledge packets
*