Since TOS is not _really_ a multi-threaded environment the callbacks allow you to more easily interleave processing while long-latency stuff is happening. Since the callbacks are called from an interrupt context you could use a global state variable to tell your main 'thread' when a read or write is complete.
But it's probably better to go with the flow and redesign your architecture to fit the event/task model... MS Séva Safris wrote:
Hi all. The telos platform implementation of HPLCC2420RAM.write() and HPLCC2420RAM.read() in the HPLCC2420M.nc file use a callback mechanism to notify readDone() and wrietDone() events. I need to know if there is an underlying reason for this asynchronous behavior?! Frankly, I need a synchronous implementation of the read() and write() functions and I am wondering if this is possible. _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
