From 601a0235879f0aa0679a7a4748e4760df12186f9 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 12 Dec 2023 14:40:08 -0800 Subject: [PATCH] As previously implemented, it's possible that our xon/off flow control could send XOFF, do a read, and then...not send XON, leading to a stuck pipe --- .../src/kaleidoscope/plugin/FocusSerial.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h index f4990b291e..862353cc4d 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h @@ -116,24 +116,29 @@ class FocusSerial : public kaleidoscope::Plugin { void read(Key &key) { manageFlowControl(); key.setRaw(Runtime.serialPort().parseInt()); + manageFlowControl(); } void read(cRGB &color) { manageFlowControl(); color.r = Runtime.serialPort().parseInt(); color.g = Runtime.serialPort().parseInt(); color.b = Runtime.serialPort().parseInt(); + manageFlowControl(); } void read(char &c) { manageFlowControl(); Runtime.serialPort().readBytes(&c, 1); + manageFlowControl(); } void read(uint8_t &u8) { manageFlowControl(); u8 = Runtime.serialPort().parseInt(); + manageFlowControl(); } void read(uint16_t &u16) { manageFlowControl(); u16 = Runtime.serialPort().parseInt(); + manageFlowControl(); }