From f4855c9279e41793262e144001293c7187e081c2 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 5 Dec 2018 07:59:10 +0100 Subject: Update the URL of LED-Stalker, to point to the new docs Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index a5363f0..b6a556c 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -502,9 +502,9 @@ void setup() { LEDRainbowEffect.brightness(150); LEDRainbowWaveEffect.brightness(150); - // The LED Stalker mode has a few effects. The one we like is - // called 'BlazingTrail'. For details on other options, - // see https://github.com/keyboardio/Kaleidoscope-LED-Stalker + // The LED Stalker mode has a few effects. The one we like is called + // 'BlazingTrail'. For details on other options, see + // https://github.com/keyboardio/Kaleidoscope/blob/master/doc/plugin/LED-Stalker.md StalkerEffect.variant = STALKER(BlazingTrail); // We want to make sure that the firmware starts with LED effects off -- cgit v1.2.3 From d9363b37815279e5004106345d93f19d584db2a2 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Sat, 8 Dec 2018 14:43:32 -0700 Subject: wrap the *super* long lines I hate to be that guy, but I was reading these on github's page when deciding whether or not to order a keyboard.io, and the extra long lines here are not automatically wrapped when browsing the repo on github. Signed-off-by: Tycho Andersen --- Model01-Firmware.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index b6a556c..66701a5 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -412,17 +412,21 @@ KALEIDOSCOPE_INIT_PLUGINS( // interface through which the keymap in EEPROM can be edited. Focus, - // FocusSettingsCommand adds a few Focus commands, intended to aid in changing some settings of the keyboard, such as the default layer (via the `settings.defaultLayer` command) + // FocusSettingsCommand adds a few Focus commands, intended to aid in + // changing some settings of the keyboard, such as the default layer (via the + // `settings.defaultLayer` command) FocusSettingsCommand, // FocusEEPROMCommand adds a set of Focus commands, which are very helpful in // both debugging, and in backing up one's EEPROM contents. FocusEEPROMCommand, - // The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected + // 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. + // 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 -- cgit v1.2.3 From 852566ee1c0d79643ea2940bd769757fb6d72a0c Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Sun, 9 Dec 2018 11:04:58 -0700 Subject: add a blurb about binding the PROG key to things Signed-off-by: Tycho Andersen --- Model01-Firmware.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 66701a5..951e24c 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -108,9 +108,15 @@ enum { MACRO_VERSION_INFO, * using ___ to let keypresses fall through to the previously active layer * using XXX to mark a keyswitch as 'blocked' on this layer * using ShiftToLayer() and LockLayer() keys to change the active keymap. - * the special nature of the PROG key * keeping NUM and FN consistent and accessible on all layers * + * The PROG key is special, since it is how you indicate to the board that you + * want to flash the firmware. However, it can be remapped to a regular key. + * When the keyboard boots, it first looks to see whether the PROG key is held + * down; if it is, it simply awaits further flashing instructions. If it is + * not, it continues loading the rest of the firmware and the keyboard + * functions normally, with whatever binding you have set to PROG. More detail + * here: https://community.keyboard.io/t/how-the-prog-key-gets-you-into-the-bootloader/506/8 * * The "keymaps" data structure is a list of the keymaps compiled into the firmware. * The order of keymaps in the list is important, as the ShiftToLayer(#) and LockLayer(#) -- cgit v1.2.3 From 7d674afe6620c0bc7e347fd908b87c0771d02a9c Mon Sep 17 00:00:00 2001 From: Jim Tittsler Date: Tue, 25 Dec 2018 11:52:47 +0900 Subject: Correct location of Makefile for library updates The `Makefile` is one directory higher than was indicated in the README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 665961f..84d0dbf 100644 --- a/README.md +++ b/README.md @@ -97,14 +97,14 @@ After that, you'll want to update the Kaleidoscope libraries. ### MacOS ```sh -cd $HOME/Documents/Arduino/hardware/keyboardio/avr +cd $HOME/Documents/Arduino/hardware/keyboardio make update-submodules ``` ### Linux ```sh -cd $HOME/Arduino/hardware/keyboardio/avr +cd $HOME/Arduino/hardware/keyboardio make update-submodules ``` -- cgit v1.2.3 From 0b00f27cbacb54ee4a333c480067427fe659dbc4 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 20 Jan 2019 08:39:58 +0100 Subject: Stop using deprecated (and now removed) APIs Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 951e24c..58b3ebe 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -341,29 +341,29 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { // Keyboardio Model 01. -static kaleidoscope::LEDSolidColor solidRed(160, 0, 0); -static kaleidoscope::LEDSolidColor solidOrange(140, 70, 0); -static kaleidoscope::LEDSolidColor solidYellow(130, 100, 0); -static kaleidoscope::LEDSolidColor solidGreen(0, 160, 0); -static kaleidoscope::LEDSolidColor solidBlue(0, 70, 130); -static kaleidoscope::LEDSolidColor solidIndigo(0, 0, 170); -static kaleidoscope::LEDSolidColor solidViolet(130, 0, 120); +static kaleidoscope::plugin::LEDSolidColor solidRed(160, 0, 0); +static kaleidoscope::plugin::LEDSolidColor solidOrange(140, 70, 0); +static kaleidoscope::plugin::LEDSolidColor solidYellow(130, 100, 0); +static kaleidoscope::plugin::LEDSolidColor solidGreen(0, 160, 0); +static kaleidoscope::plugin::LEDSolidColor solidBlue(0, 70, 130); +static kaleidoscope::plugin::LEDSolidColor solidIndigo(0, 0, 170); +static kaleidoscope::plugin::LEDSolidColor solidViolet(130, 0, 120); /** toggleLedsOnSuspendResume toggles the LEDs off when the host goes to sleep, * and turns them back on when it wakes up. */ -void toggleLedsOnSuspendResume(kaleidoscope::HostPowerManagement::Event event) { +void toggleLedsOnSuspendResume(kaleidoscope::plugin::HostPowerManagement::Event event) { switch (event) { - case kaleidoscope::HostPowerManagement::Suspend: + case kaleidoscope::plugin::HostPowerManagement::Suspend: LEDControl.paused = true; LEDControl.set_all_leds_to({0, 0, 0}); LEDControl.syncLeds(); break; - case kaleidoscope::HostPowerManagement::Resume: + case kaleidoscope::plugin::HostPowerManagement::Resume: LEDControl.paused = false; LEDControl.refreshAll(); break; - case kaleidoscope::HostPowerManagement::Sleep: + case kaleidoscope::plugin::HostPowerManagement::Sleep: break; } } @@ -372,7 +372,7 @@ void toggleLedsOnSuspendResume(kaleidoscope::HostPowerManagement::Event event) { * resume, and sleep) to other functions that perform action based on these * events. */ -void hostPowerManagementEventHandler(kaleidoscope::HostPowerManagement::Event event) { +void hostPowerManagementEventHandler(kaleidoscope::plugin::HostPowerManagement::Event event) { toggleLedsOnSuspendResume(event); } -- cgit v1.2.3 From 0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 20 Jan 2019 17:14:07 +0100 Subject: Fix turning LEDs off on suspend When suspending, we want to set all LEDs off & sync first, and only then pause LED operations. When the code was originally written, `LEDControl.syncLeds()` synced LEDs even when `LEDControl.paused` was set - it no longer does so, so we need to pause after we synced. This addresses keyboardio/Kaleidoscope#516, at least partially. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 58b3ebe..0178726 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -355,9 +355,9 @@ static kaleidoscope::plugin::LEDSolidColor solidViolet(130, 0, 120); void toggleLedsOnSuspendResume(kaleidoscope::plugin::HostPowerManagement::Event event) { switch (event) { case kaleidoscope::plugin::HostPowerManagement::Suspend: - LEDControl.paused = true; LEDControl.set_all_leds_to({0, 0, 0}); LEDControl.syncLeds(); + LEDControl.paused = true; break; case kaleidoscope::plugin::HostPowerManagement::Resume: LEDControl.paused = false; -- cgit v1.2.3 From 2532b79aa8162a03a91737635165945039eca67c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 3 Feb 2019 10:45:43 +0100 Subject: Update the EEPROMKeymap.setup() call to remove an obsolete argument EEPROM-Keymap was recently changed to work differently, and thus the mode argument became obsolete. This removes it from the call, and updates the comment above it to match current reality. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 0178726..7074861 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -525,8 +525,9 @@ void setup() { // To make the keymap editable without flashing new firmware, we store // additional layers in EEPROM. For now, we reserve space for five layers. If // one wants to use these layers, just set the default layer to one in EEPROM, - // by using the `settings.defaultLayer` Focus command. - EEPROMKeymap.setup(5, EEPROMKeymap.Mode::EXTEND); + // by using the `settings.defaultLayer` Focus command, or by using the + // `keymap.onlyCustom` command to use EEPROM layers only. + EEPROMKeymap.setup(5); } /** loop is the second of the standard Arduino sketch functions. -- cgit v1.2.3 From 04dd09403428192720463443308232069d28ccff Mon Sep 17 00:00:00 2001 From: Scott Perry Date: Fri, 15 Feb 2019 23:37:36 -0800 Subject: Use numrow keys for numpad Signed-off-by: Scott Perry --- Model01-Firmware.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 7074861..a3d798f 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -249,10 +249,10 @@ KEYMAPS( ___, ___, ___, ___, ___, - M(MACRO_VERSION_INFO), ___, Key_Keypad7, Key_Keypad8, Key_Keypad9, Key_KeypadSubtract, ___, - ___, ___, Key_Keypad4, Key_Keypad5, Key_Keypad6, Key_KeypadAdd, ___, - ___, Key_Keypad1, Key_Keypad2, Key_Keypad3, Key_Equals, ___, - ___, ___, Key_Keypad0, Key_KeypadDot, Key_KeypadMultiply, Key_KeypadDivide, Key_Enter, + M(MACRO_VERSION_INFO), ___, Key_7, Key_8, Key_9, Key_KeypadSubtract, ___, + ___, ___, Key_4, Key_5, Key_6, Key_KeypadAdd, ___, + ___, Key_1, Key_2, Key_3, Key_Equals, ___, + ___, ___, Key_0, Key_Period, Key_KeypadMultiply, Key_KeypadDivide, Key_Enter, ___, ___, ___, ___, ___), -- cgit v1.2.3 From c700ee2381a968b701138fef8685df2a5309323c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 22 Feb 2019 12:12:22 -0800 Subject: First pass fix for our Makefile pulling the right shared makefile on an unknown os. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 417a025..14a7f3c 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware -KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/ include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk -- cgit v1.2.3 From a03b96445911c9ffb586571adeb7f08b3ba3637a Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 27 Feb 2019 17:21:13 +0100 Subject: Enable the Colormap plugin too This is primarily so that one doesn't have to flash the "experimental" firmware from Chrysalis to be able to use the colormap editor there. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 7074861..5e2e115 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -57,6 +57,9 @@ // Support for an LED mode that prints the keys you press in letters 4px high #include "Kaleidoscope-LED-AlphaSquare.h" +// Support for an LED mode that lets one configure per-layer color maps +#include "Kaleidoscope-Colormap.h" + // Support for Keyboardio's internal keyboard testing mode #include "Kaleidoscope-Model01-TestMode.h" @@ -466,6 +469,9 @@ KALEIDOSCOPE_INIT_PLUGINS( // The stalker effect lights up the keys you've pressed recently StalkerEffect, + // The Colormap effect makes it possible to set up per-layer colormaps + ColormapEffect, + // The numpad plugin is responsible for lighting up the 'numpad' mode // with a custom LED effect NumPad, @@ -528,6 +534,11 @@ void setup() { // by using the `settings.defaultLayer` Focus command, or by using the // `keymap.onlyCustom` command to use EEPROM layers only. EEPROMKeymap.setup(5); + + // We need to tell the Colormap plugin how many layers we want to have custom + // maps for. To make things simple, we set it to five layers, which is how + // many editable layers we have (see above). + ColormapEffect.max_layers(5); } /** loop is the second of the standard Arduino sketch functions. -- cgit v1.2.3 From 063908a90e8a4d371d0e4907f580c1edbc6a1495 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Wed, 27 Feb 2019 18:26:30 +0100 Subject: Fallback settings for BOARD_HARDWARE_PATH This commit allows the Makefile to check if the BOARD_HARDWARE_PATH it tried to determine based on the system specific Arduino installation is correct. This is done by checking for the Kaleidoscope library's existence. If Kaleidoscope is not found, the Makefile falls back to determining the hardware path relative to its own location. This even enables building from any location where a *.ino file lives without the requirement to checkout the kaleidoscope libraries into Arduino installation's hardware path or to symlink them there. The following now is possible > SOURCE_DIR= > cd $SOURCE_DIR > mkdir hardware > git clone --recursive hardware/keyboardio > BUILD_DIR= > cd $BUILD_DIR > make -f $SOURCE_DIR/hardware/keyboardio/avr/libraries/Model01-Firmware/Makefile for quick builds > SOURCE_DIR= > cd $SOURCE_DIR > mkdir hardware > git clone --recursive hardware/keyboardio > cd hardware/keyboardio/avr/libraries/Model01-Firmware make Signed-off-by: Florian Fleissner --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 14a7f3c..9ae32d0 100644 --- a/Makefile +++ b/Makefile @@ -52,4 +52,14 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/ +# If Kaleidoscope's Arduino libraries cannot be found, e.g. because +# they reside outside of SKETCHBOOK_DIR, we fall back to assuming that +# the hardware directory can be determined in relation to the position of +# this Makefile. +ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope)","") + # Determine the path of this Makefile + MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../.. +endif + include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk -- cgit v1.2.3 From 0e865cfc3411f900e04c2061d822f79d575db929 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Thu, 28 Feb 2019 12:45:55 +0100 Subject: Makefile now checks for rules.mk when autodetecting BOARD_HARDWARE_PATH Signed-off-by: Florian Fleissner --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ae32d0..7682689 100644 --- a/Makefile +++ b/Makefile @@ -56,10 +56,17 @@ KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/ # they reside outside of SKETCHBOOK_DIR, we fall back to assuming that # the hardware directory can be determined in relation to the position of # this Makefile. -ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope)","") +ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","") # Determine the path of this Makefile MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../.. endif +ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","") +$(info ***************************************************************************) +$(info Unable to autodetect a proper BOARD_HARDWARE_PATH. Please define it manually.) +$(info ***************************************************************************) +$(info ) +endif + include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk -- cgit v1.2.3 From d392c641fced7bb5ac98010be40093da164083b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20=C3=98yvind=20Laderud?= Date: Wed, 27 Mar 2019 16:40:05 +0100 Subject: remove unused enum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hans Øyvind Laderud --- Model01-Firmware.ino | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 124be72..6a008e1 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -379,19 +379,6 @@ void hostPowerManagementEventHandler(kaleidoscope::plugin::HostPowerManagement:: toggleLedsOnSuspendResume(event); } -/** This 'enum' is a list of all the magic combos used by the Model 01's - * firmware The names aren't particularly important. What is important is that - * each is unique. - * - * These are the names of your magic combos. They will be used by the - * `USE_MAGIC_COMBOS` call below. - */ -enum { - // Toggle between Boot (6-key rollover; for BIOSes and early boot) and NKRO - // mode. - COMBO_TOGGLE_NKRO_MODE -}; - /** A tiny wrapper, to be used by MagicCombo. * This simply toggles the keyboard protocol via USBQuirks, and wraps it within * a function with an unused argument, to match what MagicCombo expects. -- cgit v1.2.3 From ccf992aa09ccc50539523015a91505743fb97116 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Thu, 6 Jun 2019 16:41:33 +0200 Subject: Replaced Kaleidoscope-Model01-TestMode ... with the more general Kaleidoscope-HardwareTestMode. By this means, the stock firmware can be build with the virtual hardware. Signed-off-by: Florian Fleissner --- Model01-Firmware.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 6a008e1..6a0ca21 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -61,7 +61,7 @@ #include "Kaleidoscope-Colormap.h" // Support for Keyboardio's internal keyboard testing mode -#include "Kaleidoscope-Model01-TestMode.h" +#include "Kaleidoscope-HardwareTestMode.h" // Support for host power management (suspend & wakeup) #include "Kaleidoscope-HostPowerManagement.h" @@ -423,7 +423,7 @@ KALEIDOSCOPE_INIT_PLUGINS( // The hardware test mode, which can be invoked by tapping Prog, LED and the // left Fn button at the same time. - TestMode, + HardwareTestMode, // LEDControl provides support for other LED modes LEDControl, -- cgit v1.2.3 From bcff391145d619eb67741dad0abda05c6d618097 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 9 Jul 2019 12:56:53 +0200 Subject: Include and initalize LEDPaletteTheme too Without the `LEDPaletteTheme` plugin, `Colormap` doesn't work either, since the palette is not initialized. Lets include and initialize the palette plugin too. Fixes #86. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 6a0ca21..7215de6 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -57,6 +57,9 @@ // Support for an LED mode that prints the keys you press in letters 4px high #include "Kaleidoscope-LED-AlphaSquare.h" +// Support for shared palettes for other plugins, like Colormap below +#include "Kaleidoscope-LED-Palette-Theme.h" + // Support for an LED mode that lets one configure per-layer color maps #include "Kaleidoscope-Colormap.h" @@ -456,6 +459,10 @@ KALEIDOSCOPE_INIT_PLUGINS( // The stalker effect lights up the keys you've pressed recently StalkerEffect, + // The LED Palette Theme plugin provides a shared palette for other plugins, + // like Colormap below + LEDPaletteTheme, + // The Colormap effect makes it possible to set up per-layer colormaps ColormapEffect, -- cgit v1.2.3 From 36e7028be8dbe5c977a137d0cb0fab0163013a7d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 29 Jul 2019 20:36:11 -0700 Subject: Revert "Replaced Kaleidoscope-Model01-TestMode" This reverts commit ccf992aa09ccc50539523015a91505743fb97116, which was an incomplete implementation --- Model01-Firmware.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 7215de6..17c99e9 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -64,7 +64,7 @@ #include "Kaleidoscope-Colormap.h" // Support for Keyboardio's internal keyboard testing mode -#include "Kaleidoscope-HardwareTestMode.h" +#include "Kaleidoscope-Model01-TestMode.h" // Support for host power management (suspend & wakeup) #include "Kaleidoscope-HostPowerManagement.h" @@ -426,7 +426,7 @@ KALEIDOSCOPE_INIT_PLUGINS( // The hardware test mode, which can be invoked by tapping Prog, LED and the // left Fn button at the same time. - HardwareTestMode, + TestMode, // LEDControl provides support for other LED modes LEDControl, -- cgit v1.2.3 From 4299824b114a001fd74ae790669ff0d39563d62d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 7 Mar 2019 18:58:02 -0800 Subject: A full implementation of the new HardwareTestMode. Signed-off-by: Jesse Vincent --- Model01-Firmware.ino | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 17c99e9..f30171d 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -64,7 +64,7 @@ #include "Kaleidoscope-Colormap.h" // Support for Keyboardio's internal keyboard testing mode -#include "Kaleidoscope-Model01-TestMode.h" +#include "Kaleidoscope-HardwareTestMode.h" // Support for host power management (suspend & wakeup) #include "Kaleidoscope-HostPowerManagement.h" @@ -382,7 +382,24 @@ void hostPowerManagementEventHandler(kaleidoscope::plugin::HostPowerManagement:: toggleLedsOnSuspendResume(event); } -/** A tiny wrapper, to be used by MagicCombo. +/** This 'enum' is a list of all the magic combos used by the Model 01's + * firmware The names aren't particularly important. What is important is that + * each is unique. + * + * These are the names of your magic combos. They will be used by the + * `USE_MAGIC_COMBOS` call below. + */ +enum { + // Toggle between Boot (6-key rollover; for BIOSes and early boot) and NKRO + // mode. + COMBO_TOGGLE_NKRO_MODE, + // Enter test mode + COMBO_ENTER_TEST_MODE +}; + +/** Wrappers, to be used by MagicCombo. **/ + +/** * This simply toggles the keyboard protocol via USBQuirks, and wraps it within * a function with an unused argument, to match what MagicCombo expects. */ @@ -390,13 +407,25 @@ static void toggleKeyboardProtocol(uint8_t combo_index) { USBQuirks.toggleKeyboardProtocol(); } +/** + * This enters the hardware test mode + */ +static void enterHardwareTestMode(uint8_t combo_index) { + HardwareTestMode.runTests(); +} + + /** Magic combo list, a list of key combo and action pairs the firmware should * recognise. */ USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, // Left Fn + Esc + Shift .keys = { R3C6, R2C6, R3C7 } - }); +}, { + .action = enterHardwareTestMode, + // Left Fn + Prog + LED + .keys = { R3C6, R0C0, R0C6 } +}); // First, tell Kaleidoscope which plugins you want to use. // The order can be important. For example, LED effects are @@ -426,7 +455,7 @@ KALEIDOSCOPE_INIT_PLUGINS( // The hardware test mode, which can be invoked by tapping Prog, LED and the // left Fn button at the same time. - TestMode, + HardwareTestMode, // LEDControl provides support for other LED modes LEDControl, @@ -512,6 +541,9 @@ void setup() { LEDRainbowEffect.brightness(150); LEDRainbowWaveEffect.brightness(150); + // Set the action key the test mode should listen for to Left Fn + HardwareTestMode.setActionKey(R3C6); + // The LED Stalker mode has a few effects. The one we like is called // 'BlazingTrail'. For details on other options, see // https://github.com/keyboardio/Kaleidoscope/blob/master/doc/plugin/LED-Stalker.md -- cgit v1.2.3 From 25d21b6386144e499ed3aba86e80d263e49e3784 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Tue, 12 Nov 2019 18:15:37 +0100 Subject: Adapted the sketch to changes in the Key API Signed-off-by: Florian Fleissner --- Model01-Firmware.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index f30171d..32623c3 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -305,7 +305,7 @@ static void anyKeyMacro(uint8_t keyState) { static Key lastKey; bool toggledOn = false; if (keyToggledOn(keyState)) { - lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36); + lastKey.setKeyCode(Key_A.getKeyCode() + (uint8_t)(millis() % 36)); toggledOn = true; } -- cgit v1.2.3 From d10ad2a9c2de3cda5b89a4e447e5d6291bd27575 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 8 Jan 2020 19:43:34 +0100 Subject: Use the new HID driver instead of the old facade While the old facade is still available, it is not included by default anymore. Instead of adding then include, just use the new APIs. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 32623c3..9a97c83 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -310,7 +310,7 @@ static void anyKeyMacro(uint8_t keyState) { } if (keyIsPressed(keyState)) - kaleidoscope::hid::pressKey(lastKey, toggledOn); + Kaleidoscope.hid().keyboard().pressKey(lastKey, toggledOn); } -- cgit v1.2.3 From 8f193dfdfff20c1a35d8cf3eb04e214b11f03485 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 8 Jan 2020 19:44:31 +0100 Subject: Use the new LEDControl.disable/LEDControl.enable methods To toggle LEDs on suspend/resume, use the new LEDControl methods instead of the old `LEDControl.paused` property. Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 9a97c83..01fe286 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -361,13 +361,10 @@ static kaleidoscope::plugin::LEDSolidColor solidViolet(130, 0, 120); void toggleLedsOnSuspendResume(kaleidoscope::plugin::HostPowerManagement::Event event) { switch (event) { case kaleidoscope::plugin::HostPowerManagement::Suspend: - LEDControl.set_all_leds_to({0, 0, 0}); - LEDControl.syncLeds(); - LEDControl.paused = true; + LEDControl.disable(); break; case kaleidoscope::plugin::HostPowerManagement::Resume: - LEDControl.paused = false; - LEDControl.refreshAll(); + LEDControl.enable(); break; case kaleidoscope::plugin::HostPowerManagement::Sleep: break; -- cgit v1.2.3 From 0fb5256b853a8c2ff6eb35433436d82c1ae76c7a Mon Sep 17 00:00:00 2001 From: ben lovett Date: Wed, 15 Jan 2020 19:54:20 -0800 Subject: Fix links to keyboard definitions. --- Model01-Firmware.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 01fe286..8162c2e 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -105,10 +105,10 @@ enum { MACRO_VERSION_INFO, * defined as part of the USB HID Keyboard specification. You can find the names * (if not yet the explanations) for all the standard `Key_` defintions offered by * Kaleidoscope in these files: - * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h - * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h - * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h - * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_keyboard.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_consumerctl.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_sysctl.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_keymaps.h * * Additional things that should be documented here include * using ___ to let keypresses fall through to the previously active layer -- cgit v1.2.3 From 397cd1a350b1e1817545d98a23afe94e387751d9 Mon Sep 17 00:00:00 2001 From: ben lovett Date: Wed, 15 Jan 2020 19:59:09 -0800 Subject: Also update LED-Stalker doc link. --- Model01-Firmware.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 8162c2e..60d5f7c 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -543,7 +543,7 @@ void setup() { // The LED Stalker mode has a few effects. The one we like is called // 'BlazingTrail'. For details on other options, see - // https://github.com/keyboardio/Kaleidoscope/blob/master/doc/plugin/LED-Stalker.md + // https://github.com/keyboardio/Kaleidoscope/blob/master/docs/plugins/LED-Stalker.md StalkerEffect.variant = STALKER(BlazingTrail); // We want to make sure that the firmware starts with LED effects off -- cgit v1.2.3