I think when you send data on the UART it'll be sent as fast as possible, but there's no way to force a 'flush' right now - interestingly this is the first time it's been requested.
When I'm using Espruino to do stuff like Modbus (I think?) where you have to force a transmit and then open the line up to receive when transmitting is finished, I work out how long the transmit will take (usually string.length*10/baudrate) and set a timeout for that.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think when you send data on the UART it'll be sent as fast as possible, but there's no way to force a 'flush' right now - interestingly this is the first time it's been requested.
When I'm using Espruino to do stuff like Modbus (I think?) where you have to force a transmit and then open the line up to receive when transmitting is finished, I work out how long the transmit will take (usually
string.length*10/baudrate
) and set a timeout for that.