From 033b8706ec2ab05531bf1cad183d10e18ec9bdab Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 8 May 2018 12:44:43 +0200 Subject: Updated to use the new plugin APIs Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 97 ++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 1549174..71d87e2 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -279,70 +279,69 @@ void hostPowerManagementEventHandler(kaleidoscope::HostPowerManagement::Event ev toggleLedsOnSuspendResume(event); } -/** The 'setup' function is one of the two standard Arduino sketch functions. - * It's called when your keyboard first powers up. This is where you set up - * Kaleidoscope and any plugins. - */ - -void setup() { - // First, call Kaleidoscope's internal setup function - Kaleidoscope.setup(); +// First, tell Kaleidoscope which plugins you want to use. +// The order can be important. For example, LED effects are +// added in the order they're listed here. +KALEIDOSCOPE_INIT_PLUGINS( + // The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected + BootGreetingEffect, - // Next, tell Kaleidoscope which plugins you want to use. - // The order can be important. For example, LED effects are - // added in the order they're listed here. - Kaleidoscope.use( - // The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected - &BootGreetingEffect, + // The hardware test mode, which can be invoked by tapping Prog, LED and the left Fn button at the same time. + TestMode, - // The hardware test mode, which can be invoked by tapping Prog, LED and the left Fn button at the same time. - &TestMode, + // LEDControl provides support for other LED modes + LEDControl, - // LEDControl provides support for other LED modes - &LEDControl, + // We start with the LED effect that turns off all the LEDs. + LEDOff, - // We start with the LED effect that turns off all the LEDs. - &LEDOff, + // The rainbow effect changes the color of all of the keyboard's keys at the same time + // running through all the colors of the rainbow. + LEDRainbowEffect, - // The rainbow effect changes the color of all of the keyboard's keys at the same time - // running through all the colors of the rainbow. - &LEDRainbowEffect, + // The rainbow wave effect lights up your keyboard with all the colors of a rainbow + // and slowly moves the rainbow across your keyboard + LEDRainbowWaveEffect, - // The rainbow wave effect lights up your keyboard with all the colors of a rainbow - // and slowly moves the rainbow across your keyboard - &LEDRainbowWaveEffect, + // The chase effect follows the adventure of a blue pixel which chases a red pixel across + // your keyboard. Spoiler: the blue pixel never catches the red pixel + LEDChaseEffect, - // The chase effect follows the adventure of a blue pixel which chases a red pixel across - // your keyboard. Spoiler: the blue pixel never catches the red pixel - &LEDChaseEffect, + // These static effects turn your keyboard's LEDs a variety of colors + solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, - // These static effects turn your keyboard's LEDs a variety of colors - &solidRed, &solidOrange, &solidYellow, &solidGreen, &solidBlue, &solidIndigo, &solidViolet, + // The breathe effect slowly pulses all of the LEDs on your keyboard + LEDBreatheEffect, - // The breathe effect slowly pulses all of the LEDs on your keyboard - &LEDBreatheEffect, + // The AlphaSquare effect prints each character you type, using your + // keyboard's LEDs as a display + AlphaSquareEffect, - // The AlphaSquare effect prints each character you type, using your - // keyboard's LEDs as a display - &AlphaSquareEffect, + // The stalker effect lights up the keys you've pressed recently + StalkerEffect, - // The stalker effect lights up the keys you've pressed recently - &StalkerEffect, + // The numpad plugin is responsible for lighting up the 'numpad' mode + // with a custom LED effect + NumPad, - // The numpad plugin is responsible for lighting up the 'numpad' mode - // with a custom LED effect - &NumPad, + // The macros plugin adds support for macros + Macros, - // The macros plugin adds support for macros - &Macros, + // The MouseKeys plugin lets you add keys to your keymap which move the mouse. + MouseKeys, - // The MouseKeys plugin lets you add keys to your keymap which move the mouse. - &MouseKeys, + // The HostPowerManagement plugin enables waking up the host from suspend, + // and allows us to turn LEDs off when it goes to sleep. + HostPowerManagement +); - // The HostPowerManagement plugin enables waking up the host from suspend, - // and allows us to turn LEDs off when it goes to sleep. - &HostPowerManagement - ); +/** The 'setup' function is one of the two standard Arduino sketch functions. + * It's called when your keyboard first powers up. This is where you set up + * Kaleidoscope and any plugins. + */ +void setup() { + // First, call Kaleidoscope's internal setup function + Kaleidoscope.setup(); // While we hope to improve this in the future, the NumPad plugin // needs to be explicitly told which keymap layer is your numpad layer -- cgit v1.2.3