Firmware stops compiling after I upgrade Kaleidoscope in Arduino IDE

I just updated my Neo2 layout a bit more (Git repo) and it worked fine.

But then I saw Arduino IDE saying that some plugins are to be upgraded, and after I did (included Keyboardio plugins), I am getting the following compile error:

Arduino:1.8.13 (Linux), Plošča:"Keyboardio Model 01"

/home/hook/Koda/Arduino/keyboardio-model01-slon/Model01-Slon-Firmware/Model01-Slon-Firmware.ino: In function 'void anyKeyMacro(uint8_t)':
Model01-Slon-Firmware:326:13: error: 'Key {aka class kaleidoscope::Key}' has no member named 'keyCode'; did you mean 'keyCode_'?
     lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36);
             ^~~~~~~
             keyCode_
Model01-Slon-Firmware:326:29: error: 'Key {aka class kaleidoscope::Key}' has no member named 'keyCode'; did you mean 'keyCode_'?
     lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36);
                             ^~~~~~~
                             keyCode_
Model01-Slon-Firmware:331:19: error: 'kaleidoscope::hid' has not been declared
     kaleidoscope::hid::pressKey(lastKey, toggledOn);
                   ^~~
/home/hook/Koda/Arduino/keyboardio-model01-slon/Model01-Slon-Firmware/Model01-Slon-Firmware.ino: In function 'void toggleLedsOnSuspendResume(kaleidoscope::plugin::HostPowerManagement::Event)':
Model01-Slon-Firmware:384:16: error: 'class kaleidoscope::plugin::LEDControl' has no member named 'paused'
     LEDControl.paused = true;
                ^~~~~~
Model01-Slon-Firmware:387:16: error: 'class kaleidoscope::plugin::LEDControl' has no member named 'paused'
     LEDControl.paused = false;
                ^~~~~~
exit status 1
'Key {aka class kaleidoscope::Key}' has no member named 'keyCode'; did you mean 'keyCode_'?


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I am not nearly programming savvy enough to tackle this on my very own without risking to brick anything, so help would be very much appreciated.

For the first two errors, you now need to use the Key::getKeyCode() method, rather than accessing the member variable directly.

For the third one, use Runtime.hid().keyboard().pressKey().

For the last two, LEDControl.enable() & LEDControl.disable().

If you look at the current version of the Model01-Firmware repository, you can see updated versions of the affected functions.

3 Likes

Perfect, thank you! That should help me quite a bit.

Will try later this week and update this thread if it worked (probably will), or if I have more questions.

I guess the best way forward would be to pull the new version of the official firmware and step-by-step recreate my changes. Right?

Is there a way to make that faster through Git?

1 Like

Commit your changes, pull from the repo, you’ll maybe get a merge conflict, open your editor, fix the conflicting parts, then do a git status: it should tell you what you should do (probably a git add <name-of-conflicting-file> && git commit.

1 Like

It took me much too long, but I managed to get it working now. Thanks.

Note for anyone else with a similar issue, I had trouble with updating the “Additional Boards” in the Arduino IDE, which I solved by:

  1. cloning GitHub - keyboardio/arduino-kaleidoscope-master: Automatic builds of the 'master' branch of Kaleidoscope for the Arduino Boards Manager
  2. In Arduino IDE FilePreferencesAdditional Board Manager URLs added the file:/// URL to the package_kaleidoscope_master_index.json file

(for some reason adding the raw.githubusercontent.com URL did not work)