Skip to main content

uart.flush()

Pauses program execution until the UART’s output FIFO has drained

Availability

Device

Returns

Nothing

Description

This blocking methods pauses Squirrel until all the bytes in the UART buffer have been sent on the wire. At this point, execution resumes.

Example Code

The following code envisages the imp connected to a computer and an Arduino on the same bus but with different parameters. It uses uart.flush() to ensure the buffer’s contents have all been sent before the bus is shut down briefly before being reconfigured.