Merge pull request #489 from keyboardio/plugin/focus/explicit-serial-begin

Require an explicit Serial.begin() for Focus
pull/260/head
Jesse Vincent 6 years ago committed by GitHub
commit 24604cba41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();

@ -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);

Loading…
Cancel
Save