diff --git a/src/kaleidoscope/Kaleidoscope.cpp b/src/kaleidoscope/Kaleidoscope.cpp index 4aa602ec..3b4fc0a7 100644 --- a/src/kaleidoscope/Kaleidoscope.cpp +++ b/src/kaleidoscope/Kaleidoscope.cpp @@ -26,6 +26,16 @@ Kaleidoscope_::Kaleidoscope_(void) { void Kaleidoscope_::setup(void) { + // We are explicitly initializing the Serial port as early as possible to + // (temporarily, hopefully) work around an issue on OSX. If we initialize + // Serial too late, no matter what we do, we'll end up reading garbage from + // the serial port. For more information, see the following issue: + // https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio/pull/7 + // + // TODO(anyone): Figure out a way we can get rid of this, and fix the bug + // properly. + Serial.begin(9600); + kaleidoscope::Hooks::onSetup(); KeyboardHardware.setup(); diff --git a/src/kaleidoscope/plugin/FocusSerial.h b/src/kaleidoscope/plugin/FocusSerial.h index ca6f856b..ef691c94 100644 --- a/src/kaleidoscope/plugin/FocusSerial.h +++ b/src/kaleidoscope/plugin/FocusSerial.h @@ -85,10 +85,6 @@ class FocusSerial : public kaleidoscope::Plugin { static constexpr char SEPARATOR = ' '; /* Hooks */ - EventHandlerResult onSetup() { - Serial.begin(9600); - return EventHandlerResult::OK; - } EventHandlerResult beforeReportingState(); EventHandlerResult onFocusEvent(const char *command);