summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGergely Nagy <algernon@users.noreply.github.com>2018-05-15 07:16:28 +0200
committerGitHub <noreply@github.com>2018-05-15 07:16:28 +0200
commitc7fab58f63b99013baa89b6637f36ad7be3bb3bc (patch)
tree2ad48fab7a5d07a9ee38c23d594bd5a94c4ea44e
parentdfb3d618054f185b32c3fd6cd9833055f5903a12 (diff)
parent033b8706ec2ab05531bf1cad183d10e18ec9bdab (diff)
downloadmodel01-firmware-c7fab58f63b99013baa89b6637f36ad7be3bb3bc.tar.gz
model01-firmware-c7fab58f63b99013baa89b6637f36ad7be3bb3bc.tar.bz2
model01-firmware-c7fab58f63b99013baa89b6637f36ad7be3bb3bc.zip
Merge pull request #52 from keyboardio/f/plugin-v2
Updated to use the new plugin APIs
-rw-r--r--Model01-Firmware.ino97
1 files 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