Merge pull request #1150 from keyboardio/setup-order

Runtime: Initialize the hardware first at setup time
pull/1154/head
Jesse Vincent 3 years ago committed by GitHub
commit 83f9dec385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,6 +37,11 @@ Runtime_::Runtime_(void) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void Runtime_::setup(void) { void Runtime_::setup(void) {
// Before doing anything else, initialize the device, so that whatever the
// rest of the hooks we'll call do, they'll be able to rely on an initialized
// device.
device().setup();
// We are explicitly initializing the Serial port as early as possible to // We are explicitly initializing the Serial port as early as possible to
// (temporarily, hopefully) work around an issue on OSX. If we initialize // (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 // Serial too late, no matter what we do, we'll end up reading garbage from
@ -50,8 +55,6 @@ void Runtime_::setup(void) {
kaleidoscope::sketch_exploration::pluginsExploreSketch(); kaleidoscope::sketch_exploration::pluginsExploreSketch();
kaleidoscope::Hooks::onSetup(); kaleidoscope::Hooks::onSetup();
device().setup();
// Clear the keyboard state array (all keys idle at start) // Clear the keyboard state array (all keys idle at start)
live_keys.clear(); live_keys.clear();

Loading…
Cancel
Save