diff options
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | Model01-Firmware.ino | 11 |
2 files changed, 29 insertions, 1 deletions
@@ -50,6 +50,23 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware -KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +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/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 diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index a3d798f..124be72 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. |