Imp.sleep background OS work

Although it’s clear that imp.sleep() halts all squirrel processing in a busy loop, does that also count for the underlying ImpOS processing of the UART ? In other words, can we count on the fact that the UART at OS level keeps on queueing incoming bytes into the FIFO while imp.sleep is active and we as a consequence can read out those bytes once the imp.sleep() returns ?
Same on the TX side, if we execute imp.sleep() immediately after writing data into the FIFO, can we assume the actual transmission on the line will continue during the imp.sleep ?

It just halts the user thread (where the squirrel runs). The rest of the OS and IRQ handlers etc will run, including putting received data into the RX fifo and sending data pending in the TX fifo.

Ensure you configure the FIFOs big enough to deal with the data you want sent/received and you should be fine.

This topic was automatically closed after 60 days. New replies are no longer allowed.