Skip to content

Commit

Permalink
As previously implemented, it's possible that our xon/off flow control
Browse files Browse the repository at this point in the history
could send XOFF, do a read, and then...not send XON, leading to a stuck
pipe
  • Loading branch information
obra committed Dec 12, 2023
1 parent 74a2010 commit 601a023
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down

0 comments on commit 601a023

Please sign in to comment.