Last minute hot fix for the GD32 Arduino core not autoflushing once per ms.

Tested to work on both a Model 01 and a Model 100. This will become
unnecessary when the GD32 Arduino core grows the ability to autoflush on
SOF packets from the host
pull/1156/head keyboardio-m100-DVT-2
Jesse Vincent 2 years ago
parent 6ba52122e2
commit 3c3ff1efc8

@ -37,6 +37,8 @@ char FocusSerial::command_[32];
uint8_t FocusSerial::buf_cursor_ = 0;
EventHandlerResult FocusSerial::afterEachCycle() {
// GD32 doesn't currently autoflush the very last packet. So manually flush here
Runtime.serialPort().flush();
// If the serial buffer is empty, we don't have any work to do
if (Runtime.serialPort().available() == 0) {
return EventHandlerResult::OK;

Loading…
Cancel
Save