flush

xod/uart/flush

Waits for the transmission of outgoing serial data to complete and then clears UART buffer.
flush
@/flush
Waits for the transmission of outgoing serial data to complete and then clears UART buffer.
UART@/uart
An UART object
UPDpulse
Flush outgoing buffer when all data transmitted
flush
UART
UPD
DONE
DONEpulse
Pulses when all outgoing data sent

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {
    void evaluate(Context ctx) {
        if (!isInputDirty<input_UPD>(ctx))
            return;

        auto uart = getValue<input_UART>(ctx);
        uart->flush();
        emitValue<output_DONE>(ctx, 1);
    }
}