From 3c3ff1efc8774eee8957cca8595306359764af62 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 3 Apr 2022 18:50:13 -0700 Subject: [PATCH] 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 --- .../src/kaleidoscope/plugin/FocusSerial.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp index 6551fd1f..b3c15c34 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp @@ -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;