Does serial input count as wake-able?

In the data flow portion of the wiki, it’s stated that:


All imp programs must be event-driven in this way; the imp will not work as expected if the code includes a “main loop” or any sort of “while(1)”. There are more sophisticated uses of sleeping and event handling which are covered in later examples.


Would serial data initializing on a port be enough to wake and in turn be processed? Would there be a lost byte, should the command be opened with an initialize bit?

Need to be able to send serial data to the imp at an interval and the imp be ready to process it.

Serial does not yet have callbacks, no, but it is buffered so if you poll often enough you won’t lose data even if your code is not running when the data arrives.


If you use imp.wakeup to poll it regularly, that’s currently the best way. We do realize that this is not ideal and event driven serial input is currently due to be added in the release after next (around a month away).

How big is the buffer?

Currently, 80 bytes input FIFO, 80 bytes output FIFO.

Peter