From 403ea4a8ec8843330a804fa98c59e7f2a49fdef0 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 28 May 2022 15:33:59 -0500 Subject: [PATCH 1/8] Remove unnecessary constructor definitions Signed-off-by: Michael Richters --- .../Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h | 2 -- plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h | 2 -- .../src/kaleidoscope/plugin/DynamicTapDance.h | 2 -- .../src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h | 2 -- .../src/kaleidoscope/plugin/EEPROM-Keymap.h | 2 -- .../src/kaleidoscope/plugin/EEPROM-Settings.h | 2 -- .../src/kaleidoscope/plugin/EEPROM-Settings/crc.h | 2 -- .../src/kaleidoscope/plugin/Escape-OneShot.h | 2 -- .../src/kaleidoscope/plugin/FingerPainter.h | 2 -- .../src/kaleidoscope/plugin/FirmwareDump.h | 2 -- plugins/Kaleidoscope-FocusSerial/README.md | 2 -- .../src/kaleidoscope/plugin/FocusSerial.h | 2 -- .../src/kaleidoscope/plugin/GhostInTheFirmware.h | 2 -- .../src/kaleidoscope/device/ez/ErgoDox.h | 2 -- .../src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h | 2 -- .../src/kaleidoscope/plugin/HardwareTestMode.h | 2 -- .../Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h | 2 -- .../src/kaleidoscope/plugin/HostOS-Focus.h | 1 - plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h | 1 - .../src/kaleidoscope/plugin/HostPowerManagement.h | 2 -- .../Kaleidoscope-IdleLEDs/src/kaleidoscope/plugin/IdleLEDs.h | 2 -- .../src/kaleidoscope/plugin/LED-ActiveLayerColor.h | 2 -- .../src/kaleidoscope/plugin/LED-ActiveModColor.h | 2 -- .../src/kaleidoscope/plugin/LED-AlphaSquare.h | 2 -- .../src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h | 2 -- plugins/Kaleidoscope-LED-Palette-Theme/README.md | 3 --- .../src/kaleidoscope/plugin/LED-Palette-Theme.h | 2 -- .../src/kaleidoscope/plugin/LED-Stalker.h | 2 -- .../src/kaleidoscope/plugin/LED-Wavepool.h | 2 -- .../src/kaleidoscope/plugin/LEDEffect-BootAnimation.h | 2 -- .../src/kaleidoscope/plugin/LEDEffect-Breathe.h | 2 -- .../src/kaleidoscope/plugin/LEDEffect-Chase.h | 2 -- .../src/kaleidoscope/plugin/LEDEffect-Rainbow.h | 4 ---- .../src/kaleidoscope/plugin/LayerFocus.h | 2 -- plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h | 1 - .../src/kaleidoscope/plugin/MagicCombo.h | 2 -- plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h | 2 -- .../Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h | 3 --- .../src/kaleidoscope/plugin/PersistentLEDMode.h | 2 -- plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h | 2 -- .../src/kaleidoscope/plugin/ShapeShifter.h | 2 -- plugins/Kaleidoscope-Steno/src/kaleidoscope/plugin/GeminiPR.h | 2 -- plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h | 2 -- .../Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h | 2 -- .../src/kaleidoscope/plugin/TopsyTurvy.h | 2 -- plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h | 2 -- .../src/kaleidoscope/plugin/TypingBreaks.h | 2 -- .../src/kaleidoscope/plugin/USB-Quirks.h | 2 -- .../Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h | 2 -- .../src/kaleidoscope/plugin/WinKeyToggle.h | 2 -- 50 files changed, 101 deletions(-) diff --git a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h index 56d280da..e51b1ecd 100644 --- a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h +++ b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h @@ -32,8 +32,6 @@ class ColormapEffect : public Plugin, public LEDModeInterface, public AccessTransientLEDMode { public: - ColormapEffect(void) {} - void max_layers(uint8_t max_); EventHandlerResult onLayerChange(); diff --git a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h index 5a70b6a9..55924a33 100644 --- a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h +++ b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h @@ -38,8 +38,6 @@ namespace kaleidoscope { namespace plugin { class Cycle : public kaleidoscope::Plugin { public: - Cycle(void) {} - static void replace(Key key); static void replace(uint8_t cycle_size, const Key cycle_steps[]); diff --git a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h index 4fcc0794..a4de8be3 100644 --- a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h +++ b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h @@ -30,8 +30,6 @@ namespace plugin { class DynamicTapDance : public kaleidoscope::Plugin { public: - DynamicTapDance() {} - EventHandlerResult onNameQuery(); EventHandlerResult onFocusEvent(const char *command); diff --git a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h index d178b4bf..377c5d9a 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h +++ b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h @@ -34,8 +34,6 @@ class EEPROMKeymapProgrammer : public kaleidoscope::Plugin { } mode_t; static mode_t mode; - EEPROMKeymapProgrammer(void) {} - static void activate(void) { nextState(); } diff --git a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h index 070d6f57..3138f075 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h +++ b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h @@ -33,8 +33,6 @@ class EEPROMKeymap : public kaleidoscope::Plugin { EXTEND }; - EEPROMKeymap(void) {} - EventHandlerResult onSetup(); EventHandlerResult onNameQuery(); EventHandlerResult onFocusEvent(const char *command); diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h index 481a601e..3c258a73 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h @@ -26,8 +26,6 @@ namespace kaleidoscope { namespace plugin { class EEPROMSettings : public kaleidoscope::Plugin { public: - EEPROMSettings(void) {} - EventHandlerResult onSetup(); EventHandlerResult beforeEachCycle(); diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h index bc193109..cfbdfa93 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h @@ -34,8 +34,6 @@ class CRC_ { public: uint16_t crc = 0; - CRC_(void){}; - void update(const void *data, uint8_t len); void finalize(void) { reflect(16); diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h index e4ea77f8..0b03b90c 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h @@ -35,8 +35,6 @@ namespace plugin { class EscapeOneShot : public kaleidoscope::Plugin { public: - EscapeOneShot(void) {} - EventHandlerResult onKeyEvent(KeyEvent &event); static void setCancelKey(Key cancel_key) { diff --git a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h index 934133c9..5ac7d58e 100644 --- a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h +++ b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h @@ -33,8 +33,6 @@ namespace plugin { // class FingerPainter : public LEDMode { public: - FingerPainter(void) {} - static void toggle(void); EventHandlerResult onKeyEvent(KeyEvent &event); diff --git a/plugins/Kaleidoscope-FirmwareDump/src/kaleidoscope/plugin/FirmwareDump.h b/plugins/Kaleidoscope-FirmwareDump/src/kaleidoscope/plugin/FirmwareDump.h index f1f2f3d0..b6f51cba 100644 --- a/plugins/Kaleidoscope-FirmwareDump/src/kaleidoscope/plugin/FirmwareDump.h +++ b/plugins/Kaleidoscope-FirmwareDump/src/kaleidoscope/plugin/FirmwareDump.h @@ -33,8 +33,6 @@ namespace plugin { class FirmwareDump : public kaleidoscope::Plugin { public: - FirmwareDump() {} - EventHandlerResult onSetup(); EventHandlerResult onFocusEvent(const char *command); diff --git a/plugins/Kaleidoscope-FocusSerial/README.md b/plugins/Kaleidoscope-FocusSerial/README.md index 95a6a64f..6e9ba698 100644 --- a/plugins/Kaleidoscope-FocusSerial/README.md +++ b/plugins/Kaleidoscope-FocusSerial/README.md @@ -20,8 +20,6 @@ Nevertheless, a very simple example is shown below: namespace kaleidoscope { class FocusTestCommand : public Plugin { public: - FocusTestCommand() {} - EventHandlerResult onNameQuery() { return ::Focus.sendName(F("FocusTestCommand")); } diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h index 44fbf737..fdb3dc2a 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h @@ -33,8 +33,6 @@ namespace kaleidoscope { namespace plugin { class FocusSerial : public kaleidoscope::Plugin { public: - FocusSerial(void) {} - static constexpr char COMMENT = '#'; static constexpr char SEPARATOR = ' '; static constexpr char NEWLINE = '\n'; diff --git a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h index b89817f7..6f26d333 100644 --- a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h +++ b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h @@ -34,8 +34,6 @@ class GhostInTheFirmware : public kaleidoscope::Plugin { }; static const GhostKey *ghost_keys; - GhostInTheFirmware(void) {} - static void activate(void); EventHandlerResult afterEachCycle(); diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h index abf278f9..3c76c610 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h @@ -60,8 +60,6 @@ struct ErgoDoxProps : public kaleidoscope::device::ATmega32U4KeyboardProps { #ifndef KALEIDOSCOPE_VIRTUAL_BUILD class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard { public: - ErgoDox(void) {} - void scanMatrix(void); void readMatrix(void); void actOnMatrixScan(void); diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h index 2d7bca98..a2de0336 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h @@ -35,8 +35,6 @@ namespace ez { class ErgoDoxScanner { public: - ErgoDoxScanner() {} - void begin(); void toggleATMegaRow(int row); void selectExtenderRow(int row); diff --git a/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.h b/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.h index a765863e..53d4bf2b 100644 --- a/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.h +++ b/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.h @@ -33,8 +33,6 @@ class HardwareTestMode : public kaleidoscope::Plugin { } chatter_data; static uint8_t actionKey; - HardwareTestMode(void) {} - static void runTests(); static void setActionKey(uint8_t key); diff --git a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h index 90be4c79..37a65d0b 100644 --- a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h +++ b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h @@ -34,8 +34,6 @@ class Heatmap : public Plugin, public LEDModeInterface, public AccessTransientLEDMode { public: - Heatmap(void) {} - static uint16_t update_delay; static const cRGB *heat_colors; static uint8_t heat_colors_length; diff --git a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS-Focus.h b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS-Focus.h index 5cdef992..3451db52 100644 --- a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS-Focus.h +++ b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS-Focus.h @@ -25,7 +25,6 @@ namespace plugin { class FocusHostOSCommand : public kaleidoscope::Plugin { public: - FocusHostOSCommand() {} EventHandlerResult onFocusEvent(const char *command); }; diff --git a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h index 1748941b..7485f018 100644 --- a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h +++ b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h @@ -41,7 +41,6 @@ typedef enum { class HostOS : public kaleidoscope::Plugin { public: - HostOS() {} EventHandlerResult onSetup(); hostos::Type os(void) { diff --git a/plugins/Kaleidoscope-HostPowerManagement/src/kaleidoscope/plugin/HostPowerManagement.h b/plugins/Kaleidoscope-HostPowerManagement/src/kaleidoscope/plugin/HostPowerManagement.h index 91fa33e6..27acb862 100644 --- a/plugins/Kaleidoscope-HostPowerManagement/src/kaleidoscope/plugin/HostPowerManagement.h +++ b/plugins/Kaleidoscope-HostPowerManagement/src/kaleidoscope/plugin/HostPowerManagement.h @@ -30,8 +30,6 @@ class HostPowerManagement : public kaleidoscope::Plugin { Resume, } Event; - HostPowerManagement(void) {} - EventHandlerResult beforeEachCycle(); private: diff --git a/plugins/Kaleidoscope-IdleLEDs/src/kaleidoscope/plugin/IdleLEDs.h b/plugins/Kaleidoscope-IdleLEDs/src/kaleidoscope/plugin/IdleLEDs.h index a3b7626a..fba1ae07 100644 --- a/plugins/Kaleidoscope-IdleLEDs/src/kaleidoscope/plugin/IdleLEDs.h +++ b/plugins/Kaleidoscope-IdleLEDs/src/kaleidoscope/plugin/IdleLEDs.h @@ -29,8 +29,6 @@ namespace plugin { class IdleLEDs : public kaleidoscope::Plugin { public: - IdleLEDs(void) {} - static uint32_t idle_time_limit; static uint32_t idleTimeoutSeconds(); diff --git a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h index d6e00c84..2f8b6f72 100644 --- a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h +++ b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h @@ -31,8 +31,6 @@ class LEDActiveLayerColorEffect : public Plugin, public LEDModeInterface, public AccessTransientLEDMode { public: - LEDActiveLayerColorEffect(void) {} - EventHandlerResult onLayerChange(); void setColormap(const cRGB colormap[]); diff --git a/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.h b/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.h index 9cace381..b4bd3cf1 100644 --- a/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.h +++ b/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.h @@ -29,8 +29,6 @@ namespace kaleidoscope { namespace plugin { class ActiveModColorEffect : public kaleidoscope::Plugin { public: - ActiveModColorEffect(void) {} - static void setHighlightColor(cRGB color) { highlight_color_ = color; } diff --git a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare.h b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare.h index 4cd28035..34fa6d1a 100644 --- a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare.h +++ b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare.h @@ -41,8 +41,6 @@ namespace kaleidoscope { namespace plugin { class AlphaSquare : public kaleidoscope::Plugin { public: - AlphaSquare(void) {} - static void display(Key key, KeyAddr key_addr, cRGB key_color); static void display(Key key, KeyAddr key_addr); static void display(Key key) { diff --git a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h index 4ef84662..4bfd4017 100644 --- a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h +++ b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h @@ -34,8 +34,6 @@ class AlphaSquareEffect : public Plugin, public LEDModeInterface, public AccessTransientLEDMode { public: - AlphaSquareEffect(void) {} - static uint16_t length; EventHandlerResult onKeyEvent(KeyEvent &event); diff --git a/plugins/Kaleidoscope-LED-Palette-Theme/README.md b/plugins/Kaleidoscope-LED-Palette-Theme/README.md index f92f249a..ffe5c00d 100644 --- a/plugins/Kaleidoscope-LED-Palette-Theme/README.md +++ b/plugins/Kaleidoscope-LED-Palette-Theme/README.md @@ -20,9 +20,6 @@ full extent, we need to create our own plugin on top of it. namespace example { class TestLEDMode : public LEDMode { - public: - TestLEDMode() {} - protected: void setup(void) final; void update(void) final; diff --git a/plugins/Kaleidoscope-LED-Palette-Theme/src/kaleidoscope/plugin/LED-Palette-Theme.h b/plugins/Kaleidoscope-LED-Palette-Theme/src/kaleidoscope/plugin/LED-Palette-Theme.h index 1d764066..44711dcd 100644 --- a/plugins/Kaleidoscope-LED-Palette-Theme/src/kaleidoscope/plugin/LED-Palette-Theme.h +++ b/plugins/Kaleidoscope-LED-Palette-Theme/src/kaleidoscope/plugin/LED-Palette-Theme.h @@ -29,8 +29,6 @@ namespace plugin { class LEDPaletteTheme : public kaleidoscope::Plugin { public: - LEDPaletteTheme(void) {} - static uint16_t reserveThemes(uint8_t max_themes); static void updateHandler(uint16_t theme_base, uint8_t theme); static void refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_addr); diff --git a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h index 424789ab..fdea4136 100644 --- a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h +++ b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h @@ -41,8 +41,6 @@ class StalkerEffect : public Plugin, virtual cRGB compute(uint8_t *step) = 0; }; - StalkerEffect(void) {} - static ColorComputer *variant; static uint16_t step_length; static cRGB inactive_color; diff --git a/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.h b/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.h index de72ce7c..d5749113 100644 --- a/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.h +++ b/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.h @@ -41,8 +41,6 @@ class WavepoolEffect : public Plugin, public LEDModeInterface, public AccessTransientLEDMode { public: - WavepoolEffect(void) {} - EventHandlerResult onKeyEvent(KeyEvent &event); // ms before idle animation starts after last keypress diff --git a/plugins/Kaleidoscope-LEDEffect-BootAnimation/src/kaleidoscope/plugin/LEDEffect-BootAnimation.h b/plugins/Kaleidoscope-LEDEffect-BootAnimation/src/kaleidoscope/plugin/LEDEffect-BootAnimation.h index d5070646..a8fdb90e 100644 --- a/plugins/Kaleidoscope-LEDEffect-BootAnimation/src/kaleidoscope/plugin/LEDEffect-BootAnimation.h +++ b/plugins/Kaleidoscope-LEDEffect-BootAnimation/src/kaleidoscope/plugin/LEDEffect-BootAnimation.h @@ -28,8 +28,6 @@ namespace kaleidoscope { namespace plugin { class BootAnimationEffect : public kaleidoscope::Plugin { public: - BootAnimationEffect(void) {} - static uint16_t timeout; static cRGB color; diff --git a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h index 000670ae..2473404a 100644 --- a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h +++ b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h @@ -27,8 +27,6 @@ namespace plugin { class LEDBreatheEffect : public Plugin, public LEDModeInterface { public: - LEDBreatheEffect(void) {} - uint8_t hue = 170; uint8_t saturation = 255; diff --git a/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.h b/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.h index 8c3efd96..8ab77f4f 100644 --- a/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.h +++ b/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.h @@ -28,8 +28,6 @@ namespace plugin { class LEDChaseEffect : public Plugin, public LEDModeInterface { public: - LEDChaseEffect(void) {} - uint8_t update_delay() { return update_delay_; } diff --git a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h index 7daa8c6e..36d1cba6 100644 --- a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h +++ b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h @@ -27,8 +27,6 @@ namespace plugin { class LEDRainbowEffect : public Plugin, public LEDModeInterface { public: - LEDRainbowEffect(void) {} - void brightness(uint8_t); uint8_t brightness(void) { return rainbow_value; @@ -70,8 +68,6 @@ class LEDRainbowEffect : public Plugin, class LEDRainbowWaveEffect : public Plugin, public LEDModeInterface { public: - LEDRainbowWaveEffect(void) {} - void brightness(uint8_t); uint8_t brightness(void) { return rainbow_value; diff --git a/plugins/Kaleidoscope-LayerFocus/src/kaleidoscope/plugin/LayerFocus.h b/plugins/Kaleidoscope-LayerFocus/src/kaleidoscope/plugin/LayerFocus.h index eff6e7b3..d7bc3eb1 100644 --- a/plugins/Kaleidoscope-LayerFocus/src/kaleidoscope/plugin/LayerFocus.h +++ b/plugins/Kaleidoscope-LayerFocus/src/kaleidoscope/plugin/LayerFocus.h @@ -26,8 +26,6 @@ namespace plugin { class LayerFocus : public kaleidoscope::Plugin { public: - LayerFocus() {} - EventHandlerResult onNameQuery(); EventHandlerResult onFocusEvent(const char *command); }; diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h index 7b0e59f0..60cec12b 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h @@ -67,7 +67,6 @@ class Leader : public kaleidoscope::Plugin { action_t action; } dictionary_t; - Leader(void) {} static const dictionary_t *dictionary; static void reset(void); diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h index 1294da30..928a8dd2 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h @@ -48,8 +48,6 @@ class MagicCombo : public kaleidoscope::Plugin { int8_t keys[MAX_COMBO_LENGTH + 1]; } Combo; - MagicCombo(void) {} - static uint16_t min_interval; EventHandlerResult onNameQuery(); diff --git a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h index d3dc22e9..b4792200 100644 --- a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h +++ b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h @@ -28,8 +28,6 @@ namespace plugin { class NumPad : public kaleidoscope::Plugin { public: - NumPad(void) {} - static uint8_t numPadLayer; static cRGB color; static uint8_t lock_hue; diff --git a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h index 63a70777..d474a1c8 100644 --- a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h +++ b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h @@ -50,9 +50,6 @@ constexpr Key OneShotLayerKey(uint8_t layer) { class OneShot : public kaleidoscope::Plugin { public: - // Constructor - // OneShot() {} - // -------------------------------------------------------------------------- // Configuration functions diff --git a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h index 47f6ffb5..59cf9706 100644 --- a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h +++ b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h @@ -28,8 +28,6 @@ namespace plugin { class PersistentLEDMode : public kaleidoscope::Plugin { public: - PersistentLEDMode() {} - EventHandlerResult onSetup(); EventHandlerResult onNameQuery(); EventHandlerResult onLEDModeChange(); diff --git a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h index ed50b3ea..98508ce7 100644 --- a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h +++ b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h @@ -31,8 +31,6 @@ namespace plugin { class Redial : public kaleidoscope::Plugin { public: - Redial(void) {} - static bool shouldRemember(Key mappedKey); EventHandlerResult onNameQuery(); diff --git a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h index 2617d9fe..7ee3df15 100644 --- a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h +++ b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h @@ -31,8 +31,6 @@ class ShapeShifter : public kaleidoscope::Plugin { Key original, replacement; } dictionary_t; - ShapeShifter(void) {} - static const dictionary_t *dictionary; EventHandlerResult onKeyEvent(KeyEvent &event); diff --git a/plugins/Kaleidoscope-Steno/src/kaleidoscope/plugin/GeminiPR.h b/plugins/Kaleidoscope-Steno/src/kaleidoscope/plugin/GeminiPR.h index 8c08d47a..dac71757 100644 --- a/plugins/Kaleidoscope-Steno/src/kaleidoscope/plugin/GeminiPR.h +++ b/plugins/Kaleidoscope-Steno/src/kaleidoscope/plugin/GeminiPR.h @@ -31,8 +31,6 @@ namespace plugin { namespace steno { class GeminiPR : public kaleidoscope::Plugin { public: - GeminiPR(void) {} - EventHandlerResult onNameQuery(); EventHandlerResult onKeyEvent(KeyEvent &event); diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h index 19754e85..bdf9aaa2 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h @@ -41,8 +41,6 @@ class Syster : public kaleidoscope::Plugin { SymbolAction } action_t; - Syster() {} - static void reset(); bool is_active(); diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h index 14355ea4..76a4f171 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h @@ -53,8 +53,6 @@ class TapDance : public kaleidoscope::Plugin { Release, }; - TapDance(void) {} - static uint16_t time_out; void actionKeys(uint8_t tap_count, ActionType tap_dance_action, uint8_t max_keys, const Key tap_keys[]); diff --git a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h index da504a90..f5952d9a 100644 --- a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h +++ b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h @@ -36,8 +36,6 @@ constexpr Key TopsyTurvyKey(Key key) { class TopsyTurvy : public kaleidoscope::Plugin { public: - TopsyTurvy(void) {} - EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult beforeReportingState(const KeyEvent &event); diff --git a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h index af12ea32..b78bc06e 100644 --- a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h +++ b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h @@ -32,8 +32,6 @@ namespace kaleidoscope { namespace plugin { class Turbo : public kaleidoscope::Plugin { public: - Turbo() {} - uint16_t interval(); void interval(uint16_t newVal); diff --git a/plugins/Kaleidoscope-TypingBreaks/src/kaleidoscope/plugin/TypingBreaks.h b/plugins/Kaleidoscope-TypingBreaks/src/kaleidoscope/plugin/TypingBreaks.h index daf9d958..a49fded8 100644 --- a/plugins/Kaleidoscope-TypingBreaks/src/kaleidoscope/plugin/TypingBreaks.h +++ b/plugins/Kaleidoscope-TypingBreaks/src/kaleidoscope/plugin/TypingBreaks.h @@ -28,8 +28,6 @@ namespace plugin { class TypingBreaks : public kaleidoscope::Plugin { public: - TypingBreaks(void) {} - typedef struct settings_t { uint16_t idle_time_limit; uint16_t lock_time_out; diff --git a/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.h b/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.h index 0fda0363..c8b5d4c9 100644 --- a/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.h +++ b/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.h @@ -23,8 +23,6 @@ namespace kaleidoscope { namespace plugin { class USBQuirks : public kaleidoscope::Plugin { public: - USBQuirks() {} - void toggleKeyboardProtocol(); }; diff --git a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h index 0eaffc9b..a68849a7 100644 --- a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h +++ b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h @@ -26,8 +26,6 @@ namespace kaleidoscope { namespace plugin { class Unicode : public kaleidoscope::Plugin { public: - Unicode(void) {} - static void start(void); static void input(void); static void end(void); diff --git a/plugins/Kaleidoscope-WinKeyToggle/src/kaleidoscope/plugin/WinKeyToggle.h b/plugins/Kaleidoscope-WinKeyToggle/src/kaleidoscope/plugin/WinKeyToggle.h index 80926b39..820aff78 100644 --- a/plugins/Kaleidoscope-WinKeyToggle/src/kaleidoscope/plugin/WinKeyToggle.h +++ b/plugins/Kaleidoscope-WinKeyToggle/src/kaleidoscope/plugin/WinKeyToggle.h @@ -25,8 +25,6 @@ namespace kaleidoscope { namespace plugin { class WinKeyToggle : public kaleidoscope::Plugin { public: - WinKeyToggle() {} - EventHandlerResult onKeyEvent(KeyEvent &event); void toggle() { enabled_ = !enabled_; From bce72c4ddc7e36214cc2bdc4aec647e370790a3b Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 28 May 2022 15:39:28 -0500 Subject: [PATCH 2/8] Convert static variables and functions to members Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/AutoShift.cpp | 19 -------- .../src/kaleidoscope/plugin/AutoShift.h | 43 +++++++++++-------- .../kaleidoscope/plugin/AutoShiftConfig.cpp | 12 +++--- .../src/kaleidoscope/plugin/CharShift.cpp | 8 ---- .../src/kaleidoscope/plugin/CharShift.h | 20 ++++----- .../src/kaleidoscope/plugin/Cycle.cpp | 5 --- .../src/kaleidoscope/plugin/Cycle.h | 14 +++--- .../src/kaleidoscope/plugin/DynamicMacros.cpp | 6 --- .../src/kaleidoscope/plugin/DynamicMacros.h | 20 ++++----- .../kaleidoscope/plugin/DynamicTapDance.cpp | 7 --- .../src/kaleidoscope/plugin/DynamicTapDance.h | 16 +++---- .../plugin/EEPROM-Keymap-Programmer.cpp | 4 -- .../plugin/EEPROM-Keymap-Programmer.h | 14 +++--- .../kaleidoscope/plugin/EEPROM-Settings.cpp | 5 --- .../src/kaleidoscope/plugin/EEPROM-Settings.h | 36 +++++++--------- .../plugin/Escape-OneShot-Config.cpp | 10 ++--- .../kaleidoscope/plugin/Escape-OneShot.cpp | 3 -- .../src/kaleidoscope/plugin/Escape-OneShot.h | 10 +++-- .../src/kaleidoscope/plugin/FingerPainter.cpp | 3 -- .../src/kaleidoscope/plugin/FingerPainter.h | 6 +-- .../src/kaleidoscope/plugin/FocusSerial.cpp | 3 -- .../src/kaleidoscope/plugin/FocusSerial.h | 8 ++-- .../plugin/GhostInTheFirmware.cpp | 4 -- .../kaleidoscope/plugin/GhostInTheFirmware.h | 10 ++--- .../src/kaleidoscope/device/ez/ErgoDox.cpp | 6 --- .../src/kaleidoscope/device/ez/ErgoDox.h | 18 ++++---- .../src/kaleidoscope/plugin/Leader.cpp | 6 --- .../src/kaleidoscope/plugin/Leader.h | 18 ++++---- .../src/kaleidoscope/plugin/MagicCombo.cpp | 1 - .../src/kaleidoscope/plugin/MagicCombo.h | 2 +- .../src/kaleidoscope/plugin/Redial.cpp | 2 - .../src/kaleidoscope/plugin/Redial.h | 2 +- .../src/kaleidoscope/plugin/ShapeShifter.cpp | 2 - .../src/kaleidoscope/plugin/ShapeShifter.h | 2 +- .../src/kaleidoscope/plugin/SpaceCadet.cpp | 13 ------ .../src/kaleidoscope/plugin/SpaceCadet.h | 16 ++++--- .../src/kaleidoscope/plugin/Syster.cpp | 5 --- .../src/kaleidoscope/plugin/Syster.h | 8 ++-- .../src/kaleidoscope/plugin/TapDance.cpp | 3 -- .../src/kaleidoscope/plugin/TapDance.h | 4 +- .../src/kaleidoscope/plugin/TopsyTurvy.cpp | 2 - .../src/kaleidoscope/plugin/TopsyTurvy.h | 2 +- .../src/kaleidoscope/plugin/Turbo.cpp | 10 ----- .../src/kaleidoscope/plugin/Turbo.h | 16 +++---- 44 files changed, 155 insertions(+), 269 deletions(-) diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.cpp b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.cpp index f627eb28..24278285 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.cpp +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.cpp @@ -29,25 +29,6 @@ namespace kaleidoscope { namespace plugin { -// ============================================================================= -// AutoShift static class variables - -// Configuration settings that can be saved to persistent storage. -AutoShift::Settings AutoShift::settings_ = { - .enabled = true, - .timeout = 175, - .enabled_categories = AutoShift::Categories::printableKeys(), -}; - -// The event tracker ensures that the `onKeyswitchEvent()` handler will follow -// the rules in order to avoid interference with other plugins and prevent -// processing the same event more than once. -KeyEventTracker AutoShift::event_tracker_; - -// If there's a delayed keypress from AutoShift, this stored event will contain -// a valid `KeyAddr`. The default constructor produces an event addr of -// `KeyAddr::none()`, so the plugin will start in an inactive state. -KeyEvent pending_event_; // ============================================================================= // AutoShift functions diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h index 76929725..7ea1c7bb 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h @@ -134,17 +134,17 @@ class AutoShift : public Plugin { // Configuration functions /// Returns `true` if AutoShift is active, `false` otherwise - static bool enabled() { + bool enabled() { return settings_.enabled; } /// Activates the AutoShift plugin (held keys will trigger auto-shift) - static void enable() { + void enable() { settings_.enabled = true; } /// Deactivates the AutoShift plugin (held keys will not trigger auto-shift) - static void disable(); + void disable(); /// Turns AutoShift on if it's off, and vice versa - static void toggle() { + void toggle() { if (settings_.enabled) { disable(); } else { @@ -153,16 +153,16 @@ class AutoShift : public Plugin { } /// Returns the hold time required to trigger auto-shift (in ms) - static uint16_t timeout() { + uint16_t timeout() { return settings_.timeout; } /// Sets the hold time required to trigger auto-shift (in ms) - static void setTimeout(uint16_t new_timeout) { + void setTimeout(uint16_t new_timeout) { settings_.timeout = new_timeout; } /// Returns the set of categories currently eligible for auto-shift - static Categories enabledCategories() { + Categories enabledCategories() { return settings_.enabled_categories; } /// Adds `category` to the set eligible for auto-shift @@ -175,19 +175,19 @@ class AutoShift : public Plugin { /// - `AutoShift::Categories::functionKeys()` /// - `AutoShift::Categories::printableKeys()` /// - `AutoShift::Categories::allKeys()` - static void enable(Categories category) { + void enable(Categories category) { settings_.enabled_categories.add(category); } /// Removes a `Key` category from the set eligible for auto-shift - static void disable(Categories category) { + void disable(Categories category) { settings_.enabled_categories.remove(category); } /// Replaces the list of `Key` categories eligible for auto-shift - static void setEnabled(Categories categories) { + void setEnabled(Categories categories) { settings_.enabled_categories = categories; } /// Returns `true` if the given category is eligible for auto-shift - static bool isEnabled(Categories category) { + bool isEnabled(Categories category) { return settings_.enabled_categories.contains(category); } @@ -225,7 +225,7 @@ class AutoShift : public Plugin { /// /// This function can be overridden by the user sketch to configure which keys /// can trigger auto-shift. - static bool isAutoShiftable(Key key); + bool isAutoShiftable(Key key); // --------------------------------------------------------------------------- // Event handlers @@ -237,19 +237,19 @@ class AutoShift : public Plugin { /// A container for AutoShift configuration settings struct Settings { /// The overall state of the plugin (on/off) - bool enabled; + bool enabled = true; /// The length of time (ms) a key must be held to trigger auto-shift - uint16_t timeout; + uint16_t timeout = 175; /// The set of `Key` categories eligible to be auto-shifted - Categories enabled_categories; + Categories enabled_categories = AutoShift::Categories::printableKeys(); }; - static Settings settings_; + Settings settings_; // --------------------------------------------------------------------------- // Key event queue state variables // A device for processing only new events - static KeyEventTracker event_tracker_; + KeyEventTracker event_tracker_; // The maximum number of events in the queue at a time. static constexpr uint8_t queue_capacity_{4}; @@ -257,12 +257,17 @@ class AutoShift : public Plugin { // The event queue stores a series of press and release events. KeyAddrEventQueue queue_; + // If there's a delayed keypress from AutoShift, this stored event will + // contain a valid `KeyAddr`. The default constructor produces an event addr + // of `KeyAddr::none()`, so the plugin will start in an inactive state. + KeyEvent pending_event_; + void flushQueue(); void flushEvent(bool is_long_press = false); bool checkForRelease() const; /// The default function for `isAutoShiftable()` - static bool enabledForKey(Key key); + bool enabledForKey(Key key); }; // ============================================================================= @@ -274,7 +279,7 @@ class AutoShiftConfig : public Plugin { private: // The base address in persistent storage for configuration data - static uint16_t settings_base_; + uint16_t settings_base_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp index ebf50aad..bf115317 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp @@ -32,20 +32,18 @@ namespace plugin { // ============================================================================= // AutoShift configurator -uint16_t AutoShiftConfig::settings_base_; - EventHandlerResult AutoShiftConfig::onSetup() { - settings_base_ = ::EEPROMSettings.requestSlice(sizeof(AutoShift::settings_)); + settings_base_ = ::EEPROMSettings.requestSlice(sizeof(AutoShift::Settings)); if (Runtime.storage().isSliceUninitialized( settings_base_, - sizeof(AutoShift::settings_))) { + sizeof(AutoShift::Settings))) { // If our slice is uninitialized, set sensible defaults. - Runtime.storage().put(settings_base_, AutoShift::settings_); + Runtime.storage().put(settings_base_, ::AutoShift.settings_); Runtime.storage().commit(); } - Runtime.storage().get(settings_base_, AutoShift::settings_); + Runtime.storage().get(settings_base_, ::AutoShift.settings_); return EventHandlerResult::OK; } @@ -112,7 +110,7 @@ EventHandlerResult AutoShiftConfig::onFocusEvent(const char *command) { break; } - Runtime.storage().put(settings_base_, AutoShift::settings_); + Runtime.storage().put(settings_base_, ::AutoShift.settings_); Runtime.storage().commit(); return EventHandlerResult::EVENT_CONSUMED; } diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp index 1a20ce09..78176d46 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp @@ -35,14 +35,6 @@ namespace kaleidoscope { namespace plugin { -// ============================================================================= -// CharShift class variables -CharShift::KeyPair const *CharShift::progmem_keypairs_{nullptr}; -uint8_t CharShift::num_keypairs_{0}; - -bool CharShift::reverse_shift_state_{false}; - - // ============================================================================= // Event handlers diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h index 01601d76..d407c2c5 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h @@ -77,42 +77,42 @@ class CharShift : public Plugin { /// Generally, it will be called via the `KEYPAIRS()` preprocessor macro, not /// directly by user code. template - static void setProgmemKeyPairs(KeyPair const (&keypairs)[_num_keypairs]) { + void setProgmemKeyPairs(KeyPair const (&keypairs)[_num_keypairs]) { progmem_keypairs_ = keypairs; num_keypairs_ = _num_keypairs; } private: // A pointer to an array of `KeyPair` objects in PROGMEM - static KeyPair const *progmem_keypairs_; + KeyPair const *progmem_keypairs_ = nullptr; // The size of the PROGMEM array of `KeyPair` objects - static uint8_t num_keypairs_; + uint8_t num_keypairs_ = 0; // If a `shift` key needs to be suppressed in `beforeReportingState()` - static bool reverse_shift_state_; + bool reverse_shift_state_ = false; /// Test for keys that should be handled by CharShift - static bool isCharShiftKey(Key key); + bool isCharShiftKey(Key key); /// Look up the `KeyPair` specified by the given keymap entry - static KeyPair decodeCharShiftKey(Key key); + KeyPair decodeCharShiftKey(Key key); /// Get the total number of KeyPairs defined /// /// This function can be overridden in order to store the `KeyPair` array in /// EEPROM instead of PROGMEM. - static uint8_t numKeyPairs(); + uint8_t numKeyPairs(); /// Get the `KeyPair` at the specified index from the defined `KeyPair` array /// /// This function can be overridden in order to store the `KeyPair` array in /// EEPROM instead of PROGMEM. - static KeyPair readKeyPair(uint8_t n); + KeyPair readKeyPair(uint8_t n); // Default for `keypairsCount()`: size of the PROGMEM array - static uint8_t numProgmemKeyPairs(); + uint8_t numProgmemKeyPairs(); // Default for `readKeypair(i)`: fetch the value from PROGMEM - static KeyPair readKeyPairFromProgmem(uint8_t n); + KeyPair readKeyPairFromProgmem(uint8_t n); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.cpp b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.cpp index b8a04dc5..0c298f0c 100644 --- a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.cpp +++ b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.cpp @@ -31,11 +31,6 @@ namespace kaleidoscope { namespace plugin { -// --- state --- -Key Cycle::last_non_cycle_key_; -KeyAddr Cycle::cycle_key_addr_{KeyAddr::invalid_state}; -uint8_t Cycle::current_modifier_flags_; -uint8_t Cycle::cycle_count_; // --- helpers --- diff --git a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h index 55924a33..f7ba39ab 100644 --- a/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h +++ b/plugins/Kaleidoscope-Cycle/src/kaleidoscope/plugin/Cycle.h @@ -38,18 +38,18 @@ namespace kaleidoscope { namespace plugin { class Cycle : public kaleidoscope::Plugin { public: - static void replace(Key key); - static void replace(uint8_t cycle_size, const Key cycle_steps[]); + void replace(Key key); + void replace(uint8_t cycle_size, const Key cycle_steps[]); EventHandlerResult onNameQuery(); EventHandlerResult onKeyEvent(KeyEvent &event); private: - static uint8_t toModFlag(uint8_t keyCode); - static Key last_non_cycle_key_; - static KeyAddr cycle_key_addr_; - static uint8_t cycle_count_; - static uint8_t current_modifier_flags_; + uint8_t toModFlag(uint8_t keyCode); + Key last_non_cycle_key_; + KeyAddr cycle_key_addr_{KeyAddr::invalid_state}; + uint8_t cycle_count_; + uint8_t current_modifier_flags_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp index 52f5b6d9..d06a56fd 100644 --- a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp +++ b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp @@ -34,12 +34,6 @@ namespace kaleidoscope { namespace plugin { -uint16_t DynamicMacros::storage_base_; -uint16_t DynamicMacros::storage_size_; -uint16_t DynamicMacros::map_[]; -uint8_t DynamicMacros::macro_count_; -Key DynamicMacros::active_macro_keys_[]; - // ============================================================================= // It might be possible to use Macros instead of reproducing it void DynamicMacros::press(Key key) { diff --git a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.h b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.h index 90545294..29e01a9c 100644 --- a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.h +++ b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.h @@ -42,20 +42,20 @@ class DynamicMacros : public kaleidoscope::Plugin { EventHandlerResult beforeReportingState(const KeyEvent &event); EventHandlerResult onFocusEvent(const char *command); - static void reserve_storage(uint16_t size); + void reserve_storage(uint16_t size); void play(uint8_t seq_id); private: - static uint16_t storage_base_; - static uint16_t storage_size_; - static uint16_t map_[32]; - static uint8_t macro_count_; - static uint8_t updateDynamicMacroCache(); - static Key active_macro_keys_[MAX_CONCURRENT_DYNAMIC_MACRO_KEYS]; - static void press(Key key); - static void release(Key key); - static void tap(Key key); + uint16_t storage_base_; + uint16_t storage_size_; + uint16_t map_[32]; + uint8_t macro_count_; + uint8_t updateDynamicMacroCache(); + Key active_macro_keys_[MAX_CONCURRENT_DYNAMIC_MACRO_KEYS]; + void press(Key key); + void release(Key key); + void tap(Key key); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp index c445aec4..14bd719f 100644 --- a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp +++ b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp @@ -34,13 +34,6 @@ namespace kaleidoscope { namespace plugin { -uint16_t DynamicTapDance::storage_base_; -uint16_t DynamicTapDance::storage_size_; -uint16_t DynamicTapDance::map_[]; -uint8_t DynamicTapDance::offset_; -uint8_t DynamicTapDance::dance_count_; -constexpr uint8_t DynamicTapDance::reserved_tap_dance_key_count_; - void DynamicTapDance::updateDynamicTapDanceCache() { uint16_t pos = storage_base_; uint8_t current_id = 0; diff --git a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h index a4de8be3..86cc1f4c 100644 --- a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h +++ b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h @@ -33,18 +33,18 @@ class DynamicTapDance : public kaleidoscope::Plugin { EventHandlerResult onNameQuery(); EventHandlerResult onFocusEvent(const char *command); - static void setup(uint8_t dynamic_offset, uint16_t size); + void setup(uint8_t dynamic_offset, uint16_t size); - static bool dance(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, TapDance::ActionType tap_dance_action); + bool dance(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, TapDance::ActionType tap_dance_action); private: - static uint16_t storage_base_; - static uint16_t storage_size_; + uint16_t storage_base_; + uint16_t storage_size_; static constexpr uint8_t reserved_tap_dance_key_count_ = ranges::TD_LAST - ranges::TD_FIRST + 1; - static uint16_t map_[reserved_tap_dance_key_count_]; - static uint8_t dance_count_; - static uint8_t offset_; - static void updateDynamicTapDanceCache(); + uint16_t map_[reserved_tap_dance_key_count_]; + uint8_t dance_count_; + uint8_t offset_; + void updateDynamicTapDanceCache(); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp index 4dc7672f..67504976 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp +++ b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp @@ -33,10 +33,6 @@ namespace kaleidoscope { namespace plugin { -uint16_t EEPROMKeymapProgrammer::update_position_; -EEPROMKeymapProgrammer::state_t EEPROMKeymapProgrammer::state_; -EEPROMKeymapProgrammer::mode_t EEPROMKeymapProgrammer::mode; -Key EEPROMKeymapProgrammer::new_key_; void EEPROMKeymapProgrammer::nextState(void) { switch (state_) { diff --git a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h index 377c5d9a..7d7035ef 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h +++ b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h @@ -32,13 +32,13 @@ class EEPROMKeymapProgrammer : public kaleidoscope::Plugin { CODE, COPY, } mode_t; - static mode_t mode; + mode_t mode; - static void activate(void) { + void activate(void) { nextState(); } - static void nextState(void); - static void cancel(void); + void nextState(void); + void cancel(void); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult onFocusEvent(const char *command); @@ -50,10 +50,10 @@ class EEPROMKeymapProgrammer : public kaleidoscope::Plugin { WAIT_FOR_CODE, WAIT_FOR_SOURCE_KEY, } state_t; - static state_t state_; + state_t state_; - static uint16_t update_position_; // layer, row, col - static Key new_key_; + uint16_t update_position_; // layer, row, col + Key new_key_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp index 4aed20ce..88684d96 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp @@ -30,11 +30,6 @@ namespace kaleidoscope { namespace plugin { -struct EEPROMSettings::settings EEPROMSettings::settings_; -bool EEPROMSettings::is_valid_; -bool EEPROMSettings::sealed_; -uint16_t EEPROMSettings::next_start_ = sizeof(EEPROMSettings::settings); - EventHandlerResult EEPROMSettings::onSetup() { Runtime.storage().get(0, settings_); diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h index 3c258a73..5c83940c 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h @@ -44,34 +44,34 @@ class EEPROMSettings : public kaleidoscope::Plugin { * fall back to not using it. */ static constexpr uint8_t VERSION_CURRENT = 0x01; - static void update(void); - static bool isValid(void); - static void invalidate(void); - static uint8_t version(void) { + void update(void); + bool isValid(void); + void invalidate(void); + uint8_t version(void) { return settings_.version; } - static uint16_t requestSlice(uint16_t size); - static void seal(void); - static uint16_t crc(void); - static uint16_t used(void); + uint16_t requestSlice(uint16_t size); + void seal(void); + uint16_t crc(void); + uint16_t used(void); - static uint8_t default_layer(uint8_t layer); - static uint8_t default_layer() { + uint8_t default_layer(uint8_t layer); + uint8_t default_layer() { return settings_.default_layer; } - static void ignoreHardcodedLayers(bool value); - static bool ignoreHardcodedLayers() { + void ignoreHardcodedLayers(bool value); + bool ignoreHardcodedLayers() { return settings_.ignore_hardcoded_layers; } private: static constexpr uint8_t IGNORE_HARDCODED_LAYER = 0x7e; - static uint16_t next_start_; - static bool is_valid_; - static bool sealed_; + uint16_t next_start_ = sizeof(EEPROMSettings::settings); + bool is_valid_; + bool sealed_; - static struct settings { + struct settings { uint8_t default_layer : 7; bool ignore_hardcoded_layers : 1; uint8_t version; @@ -81,15 +81,11 @@ class EEPROMSettings : public kaleidoscope::Plugin { class FocusSettingsCommand : public kaleidoscope::Plugin { public: - FocusSettingsCommand() {} - EventHandlerResult onFocusEvent(const char *command); }; class FocusEEPROMCommand : public kaleidoscope::Plugin { public: - FocusEEPROMCommand() {} - EventHandlerResult onFocusEvent(const char *command); }; diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp index 8b6aad0f..405c037a 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp @@ -30,20 +30,18 @@ namespace kaleidoscope { namespace plugin { -uint16_t EscapeOneShotConfig::settings_base_; - EventHandlerResult EscapeOneShotConfig::onSetup() { settings_base_ = ::EEPROMSettings.requestSlice(sizeof(EscapeOneShot::settings_)); if (Runtime.storage().isSliceUninitialized( settings_base_, - sizeof(EscapeOneShot::settings_))) { + sizeof(EscapeOneShot::Settings))) { // If our slice is uninitialized, set sensible defaults. - Runtime.storage().put(settings_base_, EscapeOneShot::settings_); + Runtime.storage().put(settings_base_, ::EscapeOneShot.settings_); Runtime.storage().commit(); } - Runtime.storage().get(settings_base_, EscapeOneShot::settings_); + Runtime.storage().get(settings_base_, ::EscapeOneShot.settings_); return EventHandlerResult::OK; } @@ -66,7 +64,7 @@ EventHandlerResult EscapeOneShotConfig::onFocusEvent(const char *command) { ::EscapeOneShot.setCancelKey(k); } - Runtime.storage().put(settings_base_, EscapeOneShot::settings_); + Runtime.storage().put(settings_base_, ::EscapeOneShot.settings_); Runtime.storage().commit(); return EventHandlerResult::EVENT_CONSUMED; } diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp index 1c7b9d96..d5cc1e41 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp @@ -27,9 +27,6 @@ namespace kaleidoscope { namespace plugin { -EscapeOneShot::Settings EscapeOneShot::settings_ = { - .cancel_oneshot_key = Key_Escape}; - EventHandlerResult EscapeOneShot::onKeyEvent(KeyEvent &event) { // We only act on an escape key (or `cancel_oneshot_key_`, if that has been // set) that has just been pressed, and not generated by some other diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h index 0b03b90c..8a2b4b35 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h @@ -37,10 +37,10 @@ class EscapeOneShot : public kaleidoscope::Plugin { public: EventHandlerResult onKeyEvent(KeyEvent &event); - static void setCancelKey(Key cancel_key) { + void setCancelKey(Key cancel_key) { settings_.cancel_oneshot_key = cancel_key; } - static Key getCancelKey() { + Key getCancelKey() { return settings_.cancel_oneshot_key; } @@ -50,7 +50,9 @@ class EscapeOneShot : public kaleidoscope::Plugin { struct Settings { Key cancel_oneshot_key; }; - static Settings settings_; + Settings settings_ = { + .cancel_oneshot_key = Key_Escape + }; }; class EscapeOneShotConfig : public Plugin { @@ -60,7 +62,7 @@ class EscapeOneShotConfig : public Plugin { EventHandlerResult onNameQuery(); private: - static uint16_t settings_base_; + uint16_t settings_base_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp index 07511754..b652872c 100644 --- a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp +++ b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp @@ -33,9 +33,6 @@ namespace kaleidoscope { namespace plugin { -uint16_t FingerPainter::color_base_; -bool FingerPainter::edit_mode_; - EventHandlerResult FingerPainter::onNameQuery() { return ::Focus.sendName(F("FingerPainter")); } diff --git a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h index 5ac7d58e..65418544 100644 --- a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h +++ b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h @@ -33,7 +33,7 @@ namespace plugin { // class FingerPainter : public LEDMode { public: - static void toggle(void); + void toggle(void); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult onFocusEvent(const char *command); @@ -45,8 +45,8 @@ class FingerPainter : public LEDMode { void refreshAt(KeyAddr key_addr) final; private: - static uint16_t color_base_; - static bool edit_mode_; + uint16_t color_base_; + bool edit_mode_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp index 1c063297..db1ae9cd 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp @@ -33,9 +33,6 @@ namespace kaleidoscope { namespace plugin { -char FocusSerial::command_[32]; -uint8_t FocusSerial::buf_cursor_ = 0; - EventHandlerResult FocusSerial::afterEachCycle() { // GD32 doesn't currently autoflush the very last packet. So manually flush here Runtime.serialPort().flush(); diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h index fdb3dc2a..f9915d52 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.h @@ -113,15 +113,15 @@ class FocusSerial : public kaleidoscope::Plugin { EventHandlerResult onFocusEvent(const char *command); private: - static char command_[32]; - static uint8_t buf_cursor_; - static void printBool(bool b); + char command_[32]; + uint8_t buf_cursor_ = 0; + void printBool(bool b); // This is a hacky workaround for the host seemingly dropping characters // when a client spams its serial port too quickly // Verified on GD32 and macOS 12.3 2022-03-29 static constexpr uint8_t focus_delay_us_after_character_ = 100; - static void delayAfterPrint() { delayMicroseconds(focus_delay_us_after_character_); } + void delayAfterPrint() { delayMicroseconds(focus_delay_us_after_character_); } }; } // namespace plugin diff --git a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp index 9d3c0dcd..8b8d1cd8 100644 --- a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp +++ b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp @@ -28,10 +28,6 @@ namespace kaleidoscope { namespace plugin { -const GhostInTheFirmware::GhostKey *GhostInTheFirmware::ghost_keys; -bool GhostInTheFirmware::is_active_ = false; -uint16_t GhostInTheFirmware::current_pos_ = 0; -uint16_t GhostInTheFirmware::start_time_; void GhostInTheFirmware::activate(void) { is_active_ = true; diff --git a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h index 6f26d333..f060933c 100644 --- a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h +++ b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h @@ -32,16 +32,16 @@ class GhostInTheFirmware : public kaleidoscope::Plugin { uint16_t press_time; uint16_t delay; }; - static const GhostKey *ghost_keys; + const GhostKey *ghost_keys; - static void activate(void); + void activate(void); EventHandlerResult afterEachCycle(); private: - static bool is_active_; - static uint16_t current_pos_; - static uint16_t start_time_; + bool is_active_ = false; + uint16_t current_pos_ = 0; + uint16_t start_time_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp index f2974393..77c49e59 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp @@ -38,12 +38,6 @@ namespace kaleidoscope { namespace device { namespace ez { -ErgoDoxScanner ErgoDox::scanner_; -uint8_t ErgoDox::previousKeyState_[matrix_rows]; -uint8_t ErgoDox::keyState_[matrix_rows]; -uint8_t ErgoDox::debounce_matrix_[matrix_rows][matrix_columns]; -uint8_t ErgoDox::debounce = 5; - static bool do_scan_ = 1; void ErgoDox::setup(void) { diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h index 3c76c610..6b2a64ae 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h @@ -78,17 +78,17 @@ class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard { void setStatusLED(uint8_t led, bool state = true); void setStatusLEDBrightness(uint8_t led, uint8_t brightness); - static uint8_t debounce; + uint8_t debounce = 5; private: - static ErgoDoxScanner scanner_; - static uint8_t previousKeyState_[matrix_rows]; - static uint8_t keyState_[matrix_rows]; - static uint8_t debounce_matrix_[matrix_rows][matrix_columns]; - - static uint8_t debounceMaskForRow(uint8_t row); - static void debounceRow(uint8_t change, uint8_t row); - static void readMatrixRow(uint8_t row); + ErgoDoxScanner scanner_; + uint8_t previousKeyState_[matrix_rows]; + uint8_t keyState_[matrix_rows]; + uint8_t debounce_matrix_[matrix_rows][matrix_columns]; + + uint8_t debounceMaskForRow(uint8_t row); + void debounceRow(uint8_t change, uint8_t row); + void readMatrixRow(uint8_t row); }; #else // ifndef KALEIDOSCOPE_VIRTUAL_BUILD class ErgoDox; diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp index 1780c44c..7f885f69 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp @@ -34,15 +34,9 @@ namespace kaleidoscope { namespace plugin { // --- state --- -Key Leader::sequence_[LEADER_MAX_SEQUENCE_LENGTH + 1]; -KeyEventTracker Leader::event_tracker_; -uint8_t Leader::sequence_pos_; -uint16_t Leader::start_time_ = 0; #ifndef NDEPRECATED uint16_t Leader::time_out = 1000; #endif -uint16_t Leader::timeout_ = 1000; -const Leader::dictionary_t *Leader::dictionary; // --- helpers --- diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h index 60cec12b..aad67353 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h @@ -67,9 +67,9 @@ class Leader : public kaleidoscope::Plugin { action_t action; } dictionary_t; - static const dictionary_t *dictionary; + const dictionary_t *dictionary; - static void reset(void); + void reset(void); #ifndef NDEPRECATED DEPRECATED(LEADER_TIME_OUT) @@ -79,7 +79,7 @@ class Leader : public kaleidoscope::Plugin { void inject(Key key, uint8_t key_state); #endif - static void setTimeout(uint16_t timeout) { + void setTimeout(uint16_t timeout) { #ifndef NDEPRECATED #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -94,13 +94,13 @@ class Leader : public kaleidoscope::Plugin { EventHandlerResult afterEachCycle(); private: - static Key sequence_[LEADER_MAX_SEQUENCE_LENGTH + 1]; - static KeyEventTracker event_tracker_; - static uint8_t sequence_pos_; - static uint16_t start_time_; - static uint16_t timeout_; + Key sequence_[LEADER_MAX_SEQUENCE_LENGTH + 1]; + KeyEventTracker event_tracker_; + uint8_t sequence_pos_; + uint16_t start_time_ = 0; + uint16_t timeout_ = 1000; - static int8_t lookup(void); + int8_t lookup(void); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp index 463fdeae..a54fea28 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp @@ -29,7 +29,6 @@ namespace kaleidoscope { namespace plugin { uint16_t MagicCombo::min_interval = 500; -uint16_t MagicCombo::start_time_ = 0; EventHandlerResult MagicCombo::onNameQuery() { return ::Focus.sendName(F("MagicCombo")); diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h index 928a8dd2..5fb5463a 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h @@ -54,7 +54,7 @@ class MagicCombo : public kaleidoscope::Plugin { EventHandlerResult afterEachCycle(); private: - static uint16_t start_time_; + uint16_t start_time_ = 0; }; namespace magiccombo { diff --git a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.cpp b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.cpp index 62430969..e0377a4f 100644 --- a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.cpp +++ b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.cpp @@ -28,8 +28,6 @@ namespace kaleidoscope { namespace plugin { -Key Redial::last_key_; - EventHandlerResult Redial::onNameQuery() { return ::Focus.sendName(F("Redial")); } diff --git a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h index 98508ce7..476620d5 100644 --- a/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h +++ b/plugins/Kaleidoscope-Redial/src/kaleidoscope/plugin/Redial.h @@ -37,7 +37,7 @@ class Redial : public kaleidoscope::Plugin { EventHandlerResult onKeyEvent(KeyEvent &event); private: - static Key last_key_; + Key last_key_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.cpp b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.cpp index 9e7d68dc..526ce71b 100644 --- a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.cpp +++ b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.cpp @@ -28,8 +28,6 @@ namespace kaleidoscope { namespace plugin { -const ShapeShifter::dictionary_t *ShapeShifter::dictionary = nullptr; - EventHandlerResult ShapeShifter::onKeyEvent(KeyEvent &event) { if (dictionary == nullptr) return EventHandlerResult::OK; diff --git a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h index 7ee3df15..312f1b20 100644 --- a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h +++ b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h @@ -31,7 +31,7 @@ class ShapeShifter : public kaleidoscope::Plugin { Key original, replacement; } dictionary_t; - static const dictionary_t *dictionary; + const dictionary_t *dictionary = nullptr; EventHandlerResult onKeyEvent(KeyEvent &event); }; diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp index e01f3312..0608b6b5 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp @@ -51,19 +51,6 @@ SpaceCadet::KeyBinding::KeyBinding(Key input, Key output, uint16_t timeout) SpaceCadet::KeyBinding *SpaceCadet::map; uint16_t SpaceCadet::time_out = 200; -// ----------------------------------------------------------------------------- -// State variables - -uint8_t SpaceCadet::mode_ = SpaceCadet::Mode::ON; - -// These variables are used to keep track of any pending unresolved SpaceCadet -// key that has been pressed. If `pending_map_index_` is negative, it means -// there is no such pending keypress. Otherwise, it holds the value of the index -// of that key in the array. -int8_t SpaceCadet::pending_map_index_ = -1; - -KeyEventTracker SpaceCadet::event_tracker_; - // ============================================================================= // SpaceCadet functions diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h index 2f521419..3e98366c 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h @@ -66,16 +66,16 @@ class SpaceCadet : public kaleidoscope::Plugin { SpaceCadet(void); // Methods - static void enable() { + void enable() { mode_ = Mode::ON; } - static void disable() { + void disable() { mode_ = Mode::OFF; } - static void enableWithoutDelay() { + void enableWithoutDelay() { mode_ = Mode::NO_DELAY; } - static bool active() { + bool active() { return (mode_ == Mode::ON || mode_ == Mode::NO_DELAY); } @@ -93,7 +93,7 @@ class SpaceCadet : public kaleidoscope::Plugin { OFF, NO_DELAY, }; - static uint8_t mode_; + uint8_t mode_; static KeyEventTracker event_tracker_; @@ -103,7 +103,11 @@ class SpaceCadet : public kaleidoscope::Plugin { // The event queue stores a series of press and release events. KeyAddrEventQueue event_queue_; - static int8_t pending_map_index_; + // This variable is used to keep track of any pending unresolved SpaceCadet + // key that has been pressed. If `pending_map_index_` is negative, it means + // there is no such pending keypress. Otherwise, it holds the value of the + // index of that key in the array. + int8_t pending_map_index_ = -1; int8_t getSpaceCadetKeyIndex(Key key) const; diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp index 6fd52603..8b0bcdec 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp @@ -31,11 +31,6 @@ namespace kaleidoscope { namespace plugin { -// --- state --- -char Syster::symbol_[SYSTER_MAX_SYMBOL_LENGTH + 1]; -uint8_t Syster::symbol_pos_; -bool Syster::is_active_; - // --- api --- void Syster::reset(void) { symbol_pos_ = 0; diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h index bdf9aaa2..c3b6487b 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h @@ -41,7 +41,7 @@ class Syster : public kaleidoscope::Plugin { SymbolAction } action_t; - static void reset(); + void reset(); bool is_active(); @@ -49,9 +49,9 @@ class Syster : public kaleidoscope::Plugin { EventHandlerResult onKeyEvent(KeyEvent &event); private: - static char symbol_[SYSTER_MAX_SYMBOL_LENGTH + 1]; - static uint8_t symbol_pos_; - static bool is_active_; + char symbol_[SYSTER_MAX_SYMBOL_LENGTH + 1]; + uint8_t symbol_pos_; + bool is_active_ = false; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp index c55b5b1b..cd787c20 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp @@ -38,9 +38,6 @@ namespace plugin { // --- config --- uint16_t TapDance::time_out = 200; -uint8_t TapDance::tap_count_ = 0; - -KeyEventTracker TapDance::event_tracker_; // --- api --- void TapDance::actionKeys(uint8_t tap_count, diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h index 76a4f171..4b2c6153 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h @@ -73,10 +73,10 @@ class TapDance : public kaleidoscope::Plugin { // The event queue stores a series of press and release events. KeyAddrEventQueue event_queue_; - static KeyEventTracker event_tracker_; + KeyEventTracker event_tracker_; // The number of taps in the current TapDance sequence. - static uint8_t tap_count_; + uint8_t tap_count_ = 0; void flushQueue(KeyAddr ignored_addr = KeyAddr::none()); }; diff --git a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.cpp b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.cpp index 6e4244fe..3b79f878 100644 --- a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.cpp +++ b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.cpp @@ -32,8 +32,6 @@ namespace kaleidoscope { namespace plugin { -KeyAddr TopsyTurvy::tt_addr_ = KeyAddr::none(); - EventHandlerResult TopsyTurvy::onKeyEvent(KeyEvent &event) { if (keyToggledOff(event.state)) { if (event.addr == tt_addr_) diff --git a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h index f5952d9a..ae6dcfd7 100644 --- a/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h +++ b/plugins/Kaleidoscope-TopsyTurvy/src/kaleidoscope/plugin/TopsyTurvy.h @@ -45,7 +45,7 @@ class TopsyTurvy : public kaleidoscope::Plugin { } private: - static KeyAddr tt_addr_; + KeyAddr tt_addr_ = KeyAddr::none(); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.cpp b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.cpp index 96cc9970..cbf04105 100644 --- a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.cpp +++ b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.cpp @@ -37,16 +37,6 @@ namespace kaleidoscope { namespace plugin { -uint16_t Turbo::interval_ = 10; -uint16_t Turbo::flash_interval_ = 69; -bool Turbo::sticky_ = false; -bool Turbo::flash_ = true; -cRGB Turbo::active_color_ = CRGB(160, 0, 0); - -bool Turbo::active_ = false; -uint32_t Turbo::start_time_ = 0; -uint32_t Turbo::flash_start_time_ = 0; - uint16_t Turbo::interval() { return interval_; } diff --git a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h index b78bc06e..918d7779 100644 --- a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h +++ b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h @@ -53,15 +53,15 @@ class Turbo : public kaleidoscope::Plugin { EventHandlerResult beforeSyncingLeds(); private: - static uint16_t interval_; - static uint16_t flash_interval_; - static bool sticky_; - static bool flash_; - static cRGB active_color_; + uint16_t interval_ = 10; + uint16_t flash_interval_ = 69; + bool sticky_ = false; + bool flash_ = true; + cRGB active_color_ = CRGB(160, 0, 0); - static bool active_; - static uint32_t start_time_; - static uint32_t flash_start_time_; + bool active_ = false; + uint32_t start_time_ = 0; + uint32_t flash_start_time_ = 0; }; } // namespace plugin From 920be03cad57c4287b1232d8c029e84141362be8 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 28 May 2022 15:51:35 -0500 Subject: [PATCH 3/8] Deprecate public member variables Signed-off-by: Michael Richters --- examples/Keystrokes/SpaceCadet/SpaceCadet.ino | 2 +- plugins/Kaleidoscope-MagicCombo/README.md | 4 +- .../src/kaleidoscope/plugin/MagicCombo.cpp | 4 +- .../src/kaleidoscope/plugin/MagicCombo.h | 35 +++++++++++++++++ plugins/Kaleidoscope-SpaceCadet/README.md | 11 +++--- .../src/kaleidoscope/plugin/SpaceCadet.cpp | 11 +++++- .../src/kaleidoscope/plugin/SpaceCadet.h | 39 ++++++++++++++++++- plugins/Kaleidoscope-TapDance/README.md | 8 ++-- .../src/kaleidoscope/plugin/TapDance.cpp | 17 +++++++- .../src/kaleidoscope/plugin/TapDance.h | 25 ++++++++++++ 10 files changed, 139 insertions(+), 17 deletions(-) diff --git a/examples/Keystrokes/SpaceCadet/SpaceCadet.ino b/examples/Keystrokes/SpaceCadet/SpaceCadet.ino index c9b983ca..63871803 100644 --- a/examples/Keystrokes/SpaceCadet/SpaceCadet.ino +++ b/examples/Keystrokes/SpaceCadet/SpaceCadet.ino @@ -59,7 +59,7 @@ void setup() { SPACECADET_MAP_END, }; //Set the map. - SpaceCadet.map = spacecadetmap; + SpaceCadet.setMap(spacecadetmap); } void loop() { diff --git a/plugins/Kaleidoscope-MagicCombo/README.md b/plugins/Kaleidoscope-MagicCombo/README.md index 88efa976..7c78221f 100644 --- a/plugins/Kaleidoscope-MagicCombo/README.md +++ b/plugins/Kaleidoscope-MagicCombo/README.md @@ -42,9 +42,9 @@ that are part of a combination. ## Plugin properties The extension provides a `MagicCombo` singleton object, with the following -property: +method: -### `.min_interval` +### `.setMinInterval(min_interval)` > Restrict the magic action to fire at most once every `min_interval` > milliseconds. diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp index a54fea28..e34bf999 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.cpp @@ -28,7 +28,9 @@ namespace kaleidoscope { namespace plugin { +#ifndef NDEPRECATED uint16_t MagicCombo::min_interval = 500; +#endif EventHandlerResult MagicCombo::onNameQuery() { return ::Focus.sendName(F("MagicCombo")); @@ -53,7 +55,7 @@ EventHandlerResult MagicCombo::afterEachCycle() { if (j != Runtime.device().pressedKeyswitchCount()) match = false; - if (match && Runtime.hasTimeExpired(start_time_, min_interval)) { + if (match && Runtime.hasTimeExpired(start_time_, getMinInterval())) { ComboAction action = (ComboAction)pgm_read_ptr((void const **)&(magiccombo::combos[i].action)); (*action)(i); diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h index 5fb5463a..a498a922 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h @@ -22,6 +22,15 @@ #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/plugin.h" // for Plugin +// ----------------------------------------------------------------------------- +// Deprecation warning messages +#include "kaleidoscope_internal/deprecations.h" // for DEPRECATED + +#define _DEPRECATED_MESSAGE_MAGICCOMBO_MIN_INTERVAL \ + "The `MagicCombo.min_interval` variable is deprecated. Please use the\n" \ + "`MagicCombo.setMinInterval()` function instead.\n" \ + "This variable will be removed after 2022-09-01." +// ----------------------------------------------------------------------------- #define MAX_COMBO_LENGTH 5 @@ -48,13 +57,39 @@ class MagicCombo : public kaleidoscope::Plugin { int8_t keys[MAX_COMBO_LENGTH + 1]; } Combo; +#ifndef NDEPRECATED + DEPRECATED(MAGICCOMBO_MIN_INTERVAL) static uint16_t min_interval; +#endif + + void setMinInterval(uint16_t interval) { +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + min_interval = interval; +#pragma GCC diagnostic pop +#else + min_interval_ = interval; +#endif + } + + uint16_t getMinInterval() { +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + return min_interval; +#pragma GCC diagnostic pop +#else + return min_interval_; +#endif + } EventHandlerResult onNameQuery(); EventHandlerResult afterEachCycle(); private: uint16_t start_time_ = 0; + uint16_t min_interval_ = 500; }; namespace magiccombo { diff --git a/plugins/Kaleidoscope-SpaceCadet/README.md b/plugins/Kaleidoscope-SpaceCadet/README.md index bae8ea0c..9ebaeb74 100644 --- a/plugins/Kaleidoscope-SpaceCadet/README.md +++ b/plugins/Kaleidoscope-SpaceCadet/README.md @@ -75,16 +75,15 @@ void setup() { , SPACECADET_MAP_END }; //Set the map. - SpaceCadet.map = spacecadetmap; + SpaceCadet.setMap(spacecadetmap); } ``` ## Plugin methods -The plugin provides the `SpaceCadet` object, with the following methods and -properties: +The plugin provides the `SpaceCadet` object, with the following methods: -### `.map` +### `.setMap(map)` > Set the key map. This takes an array of > `kaleidoscope::plugin::SpaceCadet::KeyBinding` objects with the special @@ -103,9 +102,9 @@ properties: > optional and may be set per-key or left out entirely (or set to `0`) to use > the default timeout value. -### `.time_out` +### `.setTimeout(timeout)` -> Set this property to the number of milliseconds to wait before considering a +> Sets the number of milliseconds to wait before considering a > held key in isolation as its secondary role. That is, we'd have to hold a > `Shift` key this long, by itself, to trigger the `Shift` role in itself. This > timeout setting can be overridden by an individual key in the keymap, but if diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp index 0608b6b5..a38fffe3 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp @@ -48,8 +48,10 @@ SpaceCadet::KeyBinding::KeyBinding(Key input, Key output, uint16_t timeout) // ----------------------------------------------------------------------------- // Plugin configuration variables +#ifndef NDEPRECATED SpaceCadet::KeyBinding *SpaceCadet::map; uint16_t SpaceCadet::time_out = 200; +#endif // ============================================================================= // SpaceCadet functions @@ -69,7 +71,7 @@ SpaceCadet::SpaceCadet() { */ SPACECADET_MAP_END}; - map = initialmap; + setMap(initialmap); } // ============================================================================= @@ -161,7 +163,14 @@ EventHandlerResult SpaceCadet::afterEachCycle() { return EventHandlerResult::OK; // Get timeout value for the pending key. +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" uint16_t pending_timeout = time_out; +#pragma GCC diagnostic pop +#else + uint16_t pending_timeout = timeout_; +#endif if (map[pending_map_index_].timeout != 0) pending_timeout = map[pending_map_index_].timeout; uint16_t start_time = event_queue_.timestamp(0); diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h index 3e98366c..4ed35a64 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h @@ -27,6 +27,15 @@ #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/key_defs.h" // for Key, Key_NoKey #include "kaleidoscope/plugin.h" // for Plugin +// ----------------------------------------------------------------------------- +// Deprecation warning messages +#include "kaleidoscope_internal/deprecations.h" // for DEPRECATED + +#define _DEPRECATED_MESSAGE_SPACECADET_TIME_OUT \ + "The `SpaceCadet.time_out` variable is deprecated. Please use the\n" \ + "`SpaceCadet.setTimeout()` function instead.\n" \ + "This variable will be removed after 2022-09-01." +// ----------------------------------------------------------------------------- #ifndef SPACECADET_MAP_END #define SPACECADET_MAP_END \ @@ -79,9 +88,27 @@ class SpaceCadet : public kaleidoscope::Plugin { return (mode_ == Mode::ON || mode_ == Mode::NO_DELAY); } +#ifndef NDEPRECATED // Publically accessible variables + DEPRECATED(SPACECADET_TIME_OUT) static uint16_t time_out; // The global timeout in milliseconds static SpaceCadet::KeyBinding *map; // The map of key bindings +#endif + + void setTimeout(uint16_t timeout) { +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + time_out = timeout; +#pragma GCC diagnostic pop +#else + timeout_ = timeout; +#endif + } + + void setMap(KeyBinding *bindings) { + map = bindings; + } EventHandlerResult onNameQuery(); EventHandlerResult onKeyswitchEvent(KeyEvent &event); @@ -95,7 +122,17 @@ class SpaceCadet : public kaleidoscope::Plugin { }; uint8_t mode_; - static KeyEventTracker event_tracker_; +#ifdef NDEPRECATED + // Global timeout in milliseconds + uint16_t timeout_ = 200; + + // The map of keybindings + KeyBinding *map = nullptr; + // When DEPRECATED public `map[]` variable is removed, this variable name + // should be given a trailing underscore to conform to code style guide. +#endif + + KeyEventTracker event_tracker_; // The maximum number of events in the queue at a time. static constexpr uint8_t queue_capacity_{4}; diff --git a/plugins/Kaleidoscope-TapDance/README.md b/plugins/Kaleidoscope-TapDance/README.md index 8d77b37b..39e2e692 100644 --- a/plugins/Kaleidoscope-TapDance/README.md +++ b/plugins/Kaleidoscope-TapDance/README.md @@ -102,12 +102,12 @@ void setup() { The plugin provides a `TapDance` object, but to implement the actions, we need to define a function ([`tapDanceAction`][tdaction]) outside of the object. A handler, of sorts. Nevertheless, the plugin provides one macro that is -particularly useful: `tapDanceActionKeys`. Apart from that, it provides one -property only: +particularly useful: `tapDanceActionKeys`. Apart from that, it provides only one +configuration method: -### `.time_out` +### `.setTimeout(timeout)` -> The number of loop iterations to wait before a tap-dance sequence times out. +> Set the number of milliseconds to wait before a tap-dance sequence times out. > Once the sequence timed out, the action for it will trigger, even without an > interruptor. Defaults to 5, and the timer resets with every tap of the same diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp index cd787c20..14cbe932 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp @@ -37,7 +37,9 @@ namespace plugin { // --- config --- +#ifndef NDEPRECATED uint16_t TapDance::time_out = 200; +#endif // --- api --- void TapDance::actionKeys(uint8_t tap_count, @@ -143,7 +145,20 @@ EventHandlerResult TapDance::afterEachCycle() { // Check for timeout uint16_t start_time = event_queue_.timestamp(0); - if (Runtime.hasTimeExpired(start_time, time_out)) { + // To avoid confusing editors with unmatched braces, we use a temporary + // boolean, until the deprecated code can be removed. + bool timed_out = false; +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + if (Runtime.hasTimeExpired(start_time, time_out)) + timed_out = true; +#pragma GCC diagnostic pop +#else + if (Runtime.hasTimeExpired(start_time, timeout_)) + timed_out = true; +#endif + if (timed_out) { // We start with the assumption that the TapDance key is still being held. ActionType action = Hold; // Now we search for a release event for the TapDance key, starting from the diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h index 4b2c6153..2a0c0acb 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.h @@ -28,6 +28,15 @@ #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/key_defs.h" // for Key #include "kaleidoscope/plugin.h" // for Plugin +// ----------------------------------------------------------------------------- +// Deprecation warning messages +#include "kaleidoscope_internal/deprecations.h" // for DEPRECATED + +#define _DEPRECATED_MESSAGE_TAPDANCE_TIME_OUT \ + "The `TapDance.time_out` variable is deprecated. Please use the\n" \ + "`TapDance.setTimeout()` function instead.\n" \ + "This variable will be removed after 2022-09-01." +// ----------------------------------------------------------------------------- #define TD(n) kaleidoscope::plugin::TapDanceKey(n) @@ -53,7 +62,20 @@ class TapDance : public kaleidoscope::Plugin { Release, }; +#ifndef NDEPRECATED + DEPRECATED(TAPDANCE_TIME_OUT) static uint16_t time_out; +#endif + + void setTimeout(uint16_t timeout) { +#ifndef NDEPRECATED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + time_out = timeout; +#pragma GCC diagnostic pop +#endif + timeout_ = timeout; + } void actionKeys(uint8_t tap_count, ActionType tap_dance_action, uint8_t max_keys, const Key tap_keys[]); @@ -78,6 +100,9 @@ class TapDance : public kaleidoscope::Plugin { // The number of taps in the current TapDance sequence. uint8_t tap_count_ = 0; + // Time to wait for another input event before resolving a TapDance sequence. + uint16_t timeout_ = 200; + void flushQueue(KeyAddr ignored_addr = KeyAddr::none()); }; From 2df20b1a5ae81ac311469a38270c1ea5bfaf6354 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 28 May 2022 15:55:41 -0500 Subject: [PATCH 4/8] Replace C-style typedefs with idiomatic C++ code Signed-off-by: Michael Richters --- plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h | 4 ++-- .../src/kaleidoscope/plugin/MagicCombo.h | 4 ++-- .../src/kaleidoscope/plugin/ShapeShifter.h | 4 ++-- plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h index aad67353..b1ff9e03 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h @@ -62,10 +62,10 @@ constexpr Key LeaderKey(uint8_t n) { class Leader : public kaleidoscope::Plugin { public: typedef void (*action_t)(uint8_t seq_index); - typedef struct { + struct dictionary_t { Key sequence[LEADER_MAX_SEQUENCE_LENGTH + 1]; action_t action; - } dictionary_t; + }; const dictionary_t *dictionary; diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h index a498a922..696f0642 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h @@ -52,10 +52,10 @@ namespace plugin { class MagicCombo : public kaleidoscope::Plugin { public: typedef void (*ComboAction)(uint8_t combo_index); - typedef struct { + struct Combo { ComboAction action; int8_t keys[MAX_COMBO_LENGTH + 1]; - } Combo; + }; #ifndef NDEPRECATED DEPRECATED(MAGICCOMBO_MIN_INTERVAL) diff --git a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h index 312f1b20..aa0a7988 100644 --- a/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h +++ b/plugins/Kaleidoscope-ShapeShifter/src/kaleidoscope/plugin/ShapeShifter.h @@ -27,9 +27,9 @@ namespace plugin { class ShapeShifter : public kaleidoscope::Plugin { public: - typedef struct { + struct dictionary_t { Key original, replacement; - } dictionary_t; + }; const dictionary_t *dictionary = nullptr; diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h index c3b6487b..39e1a79c 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h @@ -35,11 +35,11 @@ namespace plugin { class Syster : public kaleidoscope::Plugin { public: - typedef enum { + enum action_t : uint8_t { StartAction, EndAction, SymbolAction - } action_t; + }; void reset(); From 1f965da243905fe2b013a0701439ea0c53158c61 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 28 May 2022 16:02:44 -0500 Subject: [PATCH 5/8] Remove C-style `void` parameter for functions that don't take args Signed-off-by: Michael Richters --- plugins/Kaleidoscope-Colormap/README.md | 2 +- .../src/kaleidoscope/plugin/Colormap.cpp | 2 +- .../src/kaleidoscope/plugin/Colormap.h | 2 +- plugins/Kaleidoscope-Cycle/README.md | 2 +- plugins/Kaleidoscope-Devel-ArduinoTrace/README.md | 2 +- .../plugin/EEPROM-Keymap-Programmer.cpp | 4 ++-- .../kaleidoscope/plugin/EEPROM-Keymap-Programmer.h | 6 +++--- .../src/kaleidoscope/plugin/EEPROM-Keymap.cpp | 2 +- .../src/kaleidoscope/plugin/EEPROM-Keymap.h | 4 ++-- .../src/kaleidoscope/plugin/EEPROM-Settings.cpp | 12 ++++++------ .../src/kaleidoscope/plugin/EEPROM-Settings.h | 14 +++++++------- .../src/kaleidoscope/plugin/EEPROM-Settings/crc.h | 2 +- .../src/kaleidoscope/plugin/FingerPainter.cpp | 4 ++-- .../src/kaleidoscope/plugin/FingerPainter.h | 4 ++-- .../src/kaleidoscope/plugin/GhostInTheFirmware.cpp | 2 +- .../src/kaleidoscope/plugin/GhostInTheFirmware.h | 2 +- .../src/kaleidoscope/device/ez/ErgoDox.cpp | 2 +- .../src/kaleidoscope/device/ez/ErgoDox.h | 6 +++--- .../src/kaleidoscope/device/keyboardio/Imago.cpp | 2 +- .../src/kaleidoscope/device/keyboardio/Model01.cpp | 4 ++-- .../kaleidoscope/device/keyboardio/Model100.cpp | 6 +++--- .../src/kaleidoscope/plugin/HardwareTestMode.cpp | 2 +- .../src/kaleidoscope/plugin/Heatmap.cpp | 6 +++--- .../src/kaleidoscope/plugin/Heatmap.h | 4 ++-- plugins/Kaleidoscope-HostOS/README.md | 4 ++-- .../src/kaleidoscope/plugin/HostOS.cpp | 2 +- .../src/kaleidoscope/plugin/HostOS.h | 2 +- plugins/Kaleidoscope-IdleLEDs/README.md | 4 ++-- .../kaleidoscope/plugin/LED-ActiveLayerColor.cpp | 2 +- .../src/kaleidoscope/plugin/LED-ActiveLayerColor.h | 2 +- .../kaleidoscope/plugin/LED-AlphaSquare/Effect.cpp | 2 +- .../kaleidoscope/plugin/LED-AlphaSquare/Effect.h | 2 +- plugins/Kaleidoscope-LED-Palette-Theme/README.md | 8 ++++---- .../src/kaleidoscope/plugin/LED-Stalker.cpp | 6 +++--- .../src/kaleidoscope/plugin/LED-Stalker.h | 6 +++--- .../src/kaleidoscope/plugin/LED-Wavepool.cpp | 2 +- .../kaleidoscope/plugin/LEDEffect-BootGreeting.cpp | 2 +- .../kaleidoscope/plugin/LEDEffect-BootGreeting.h | 2 +- .../src/kaleidoscope/plugin/LEDEffect-Breathe.cpp | 2 +- .../src/kaleidoscope/plugin/LEDEffect-Breathe.h | 2 +- .../src/kaleidoscope/plugin/LEDEffect-Chase.cpp | 2 +- .../src/kaleidoscope/plugin/LEDEffect-Rainbow.cpp | 4 ++-- .../src/kaleidoscope/plugin/LEDEffect-Rainbow.h | 8 ++++---- .../kaleidoscope/plugin/LEDEffect-SolidColor.cpp | 2 +- .../src/kaleidoscope/plugin/LEDEffect-SolidColor.h | 2 +- plugins/Kaleidoscope-LEDEffects/README.md | 2 +- .../src/kaleidoscope/plugin/TriColor.cpp | 2 +- .../src/kaleidoscope/plugin/TriColor.h | 2 +- .../src/kaleidoscope/plugin/Leader.cpp | 4 ++-- .../src/kaleidoscope/plugin/Leader.h | 4 ++-- .../src/kaleidoscope/plugin/MouseKeys.cpp | 2 +- .../src/kaleidoscope/plugin/NumPad.cpp | 4 ++-- .../src/kaleidoscope/plugin/NumPad.h | 4 ++-- .../src/kaleidoscope/plugin/SpaceCadet.h | 2 +- .../src/kaleidoscope/plugin/Syster.cpp | 4 ++-- plugins/Kaleidoscope-TypingBreaks/README.md | 2 +- .../src/kaleidoscope/plugin/Unicode.cpp | 12 ++++++------ .../src/kaleidoscope/plugin/Unicode.h | 12 ++++++------ 58 files changed, 111 insertions(+), 111 deletions(-) diff --git a/plugins/Kaleidoscope-Colormap/README.md b/plugins/Kaleidoscope-Colormap/README.md index 930aa430..f5a438f9 100644 --- a/plugins/Kaleidoscope-Colormap/README.md +++ b/plugins/Kaleidoscope-Colormap/README.md @@ -28,7 +28,7 @@ KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, ColormapEffect, Focus); -void setup(void) { +void setup() { Kaleidoscope.setup(); ColormapEffect.max_layers(1); diff --git a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.cpp b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.cpp index 1af6f7a9..371614d7 100644 --- a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.cpp +++ b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.cpp @@ -47,7 +47,7 @@ EventHandlerResult ColormapEffect::onNameQuery() { return ::Focus.sendName(F("ColormapEffect")); } -void ColormapEffect::TransientLEDMode::onActivate(void) { +void ColormapEffect::TransientLEDMode::onActivate() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h index e51b1ecd..76583519 100644 --- a/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h +++ b/plugins/Kaleidoscope-Colormap/src/kaleidoscope/plugin/Colormap.h @@ -52,7 +52,7 @@ class ColormapEffect : public Plugin, protected: friend class ColormapEffect; - void onActivate(void) final; + void onActivate() final; void refreshAt(KeyAddr key_addr) final; private: diff --git a/plugins/Kaleidoscope-Cycle/README.md b/plugins/Kaleidoscope-Cycle/README.md index ef99614d..53411b47 100644 --- a/plugins/Kaleidoscope-Cycle/README.md +++ b/plugins/Kaleidoscope-Cycle/README.md @@ -34,7 +34,7 @@ void cycleAction(Key previous_key, uint8_t cycle_count) { KALEIDOSCOPE_INIT_PLUGINS(Cycle); -void setup(void) { +void setup() { Kaleidoscope.setup(); } ``` diff --git a/plugins/Kaleidoscope-Devel-ArduinoTrace/README.md b/plugins/Kaleidoscope-Devel-ArduinoTrace/README.md index 27f3b344..e0d4a182 100644 --- a/plugins/Kaleidoscope-Devel-ArduinoTrace/README.md +++ b/plugins/Kaleidoscope-Devel-ArduinoTrace/README.md @@ -15,7 +15,7 @@ the box, without any further configuration: /* ... */ -void setup (void) { +void setup () { Kaleidoscope.setup (); TRACE() } diff --git a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp index 67504976..3f9793af 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp +++ b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.cpp @@ -34,7 +34,7 @@ namespace kaleidoscope { namespace plugin { -void EEPROMKeymapProgrammer::nextState(void) { +void EEPROMKeymapProgrammer::nextState() { switch (state_) { case INACTIVE: state_ = WAIT_FOR_KEY; @@ -54,7 +54,7 @@ void EEPROMKeymapProgrammer::nextState(void) { } } -void EEPROMKeymapProgrammer::cancel(void) { +void EEPROMKeymapProgrammer::cancel() { update_position_ = 0; new_key_ = Key_NoKey; state_ = INACTIVE; diff --git a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h index 7d7035ef..479381c6 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h +++ b/plugins/Kaleidoscope-EEPROM-Keymap-Programmer/src/kaleidoscope/plugin/EEPROM-Keymap-Programmer.h @@ -34,11 +34,11 @@ class EEPROMKeymapProgrammer : public kaleidoscope::Plugin { } mode_t; mode_t mode; - void activate(void) { + void activate() { nextState(); } - void nextState(void); - void cancel(void); + void nextState(); + void cancel(); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult onFocusEvent(const char *command); diff --git a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.cpp b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.cpp index be12dab7..fae574b6 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.cpp +++ b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.cpp @@ -82,7 +82,7 @@ Key EEPROMKeymap::getKeyExtended(uint8_t layer, KeyAddr key_addr) { return getKey(layer - progmem_layers_, key_addr); } -uint16_t EEPROMKeymap::keymap_base(void) { +uint16_t EEPROMKeymap::keymap_base() { return keymap_base_; } diff --git a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h index 3138f075..3f68c100 100644 --- a/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h +++ b/plugins/Kaleidoscope-EEPROM-Keymap/src/kaleidoscope/plugin/EEPROM-Keymap.h @@ -41,7 +41,7 @@ class EEPROMKeymap : public kaleidoscope::Plugin { static void max_layers(uint8_t max); - static uint16_t keymap_base(void); + static uint16_t keymap_base(); static Key getKey(uint8_t layer, KeyAddr key_addr); static Key getKeyExtended(uint8_t layer, KeyAddr key_addr); @@ -53,7 +53,7 @@ class EEPROMKeymap : public kaleidoscope::Plugin { static uint8_t max_layers_; static uint8_t progmem_layers_; - static Key parseKey(void); + static Key parseKey(); static void printKey(Key key); static void dumpKeymap(uint8_t layers, Key (*getkey)(uint8_t, KeyAddr)); }; diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp index 88684d96..5a21ee90 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.cpp @@ -65,11 +65,11 @@ EventHandlerResult EEPROMSettings::beforeEachCycle() { return EventHandlerResult::OK; } -bool EEPROMSettings::isValid(void) { +bool EEPROMSettings::isValid() { return is_valid_; } -uint16_t EEPROMSettings::crc(void) { +uint16_t EEPROMSettings::crc() { if (sealed_) return settings_.crc; return 0; @@ -100,7 +100,7 @@ void EEPROMSettings::ignoreHardcodedLayers(bool value) { update(); } -void EEPROMSettings::seal(void) { +void EEPROMSettings::seal() { sealed_ = true; CRCCalculator.finalize(); @@ -141,15 +141,15 @@ uint16_t EEPROMSettings::requestSlice(uint16_t size) { return start; } -void EEPROMSettings::invalidate(void) { +void EEPROMSettings::invalidate() { is_valid_ = false; } -uint16_t EEPROMSettings::used(void) { +uint16_t EEPROMSettings::used() { return next_start_; } -void EEPROMSettings::update(void) { +void EEPROMSettings::update() { Runtime.storage().put(0, settings_); Runtime.storage().commit(); is_valid_ = true; diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h index 5c83940c..32bb5363 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h @@ -44,17 +44,17 @@ class EEPROMSettings : public kaleidoscope::Plugin { * fall back to not using it. */ static constexpr uint8_t VERSION_CURRENT = 0x01; - void update(void); - bool isValid(void); - void invalidate(void); - uint8_t version(void) { + void update(); + bool isValid(); + void invalidate(); + uint8_t version() { return settings_.version; } uint16_t requestSlice(uint16_t size); - void seal(void); - uint16_t crc(void); - uint16_t used(void); + void seal(); + uint16_t crc(); + uint16_t used(); uint8_t default_layer(uint8_t layer); uint8_t default_layer() { diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h index cfbdfa93..578313b7 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings/crc.h @@ -35,7 +35,7 @@ class CRC_ { uint16_t crc = 0; void update(const void *data, uint8_t len); - void finalize(void) { + void finalize() { reflect(16); } void reflect(uint8_t len); diff --git a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp index b652872c..2ed60776 100644 --- a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp +++ b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.cpp @@ -42,7 +42,7 @@ EventHandlerResult FingerPainter::onSetup() { return EventHandlerResult::OK; } -void FingerPainter::update(void) { +void FingerPainter::update() { ::LEDPaletteTheme.updateHandler(color_base_, 0); } @@ -50,7 +50,7 @@ void FingerPainter::refreshAt(KeyAddr key_addr) { ::LEDPaletteTheme.refreshAt(color_base_, 0, key_addr); } -void FingerPainter::toggle(void) { +void FingerPainter::toggle() { edit_mode_ = !edit_mode_; } diff --git a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h index 65418544..709e8eaf 100644 --- a/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h +++ b/plugins/Kaleidoscope-FingerPainter/src/kaleidoscope/plugin/FingerPainter.h @@ -33,7 +33,7 @@ namespace plugin { // class FingerPainter : public LEDMode { public: - void toggle(void); + void toggle(); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult onFocusEvent(const char *command); @@ -41,7 +41,7 @@ class FingerPainter : public LEDMode { EventHandlerResult onNameQuery(); protected: - void update(void) final; + void update() final; void refreshAt(KeyAddr key_addr) final; private: diff --git a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp index 8b8d1cd8..7af0253a 100644 --- a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp +++ b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.cpp @@ -29,7 +29,7 @@ namespace kaleidoscope { namespace plugin { -void GhostInTheFirmware::activate(void) { +void GhostInTheFirmware::activate() { is_active_ = true; } diff --git a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h index f060933c..08c3e0b6 100644 --- a/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h +++ b/plugins/Kaleidoscope-GhostInTheFirmware/src/kaleidoscope/plugin/GhostInTheFirmware.h @@ -34,7 +34,7 @@ class GhostInTheFirmware : public kaleidoscope::Plugin { }; const GhostKey *ghost_keys; - void activate(void); + void activate(); EventHandlerResult afterEachCycle(); diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp index 77c49e59..2868fc63 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.cpp @@ -40,7 +40,7 @@ namespace ez { static bool do_scan_ = 1; -void ErgoDox::setup(void) { +void ErgoDox::setup() { wdt_disable(); delay(100); diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h index 6b2a64ae..692b4bc9 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h @@ -60,9 +60,9 @@ struct ErgoDoxProps : public kaleidoscope::device::ATmega32U4KeyboardProps { #ifndef KALEIDOSCOPE_VIRTUAL_BUILD class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard { public: - void scanMatrix(void); - void readMatrix(void); - void actOnMatrixScan(void); + void scanMatrix(); + void readMatrix(); + void actOnMatrixScan(); void setup(); bool isKeyswitchPressed(KeyAddr key_addr); diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Imago/src/kaleidoscope/device/keyboardio/Imago.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Imago/src/kaleidoscope/device/keyboardio/Imago.cpp index db419ecd..46a74d5d 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Imago/src/kaleidoscope/device/keyboardio/Imago.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Imago/src/kaleidoscope/device/keyboardio/Imago.cpp @@ -102,7 +102,7 @@ void ImagoLEDDriver::twiSend(uint8_t addr, uint8_t Reg_Add, uint8_t Reg_Dat) { uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0); } -void ImagoLEDDriver::unlockRegister(void) { +void ImagoLEDDriver::unlockRegister() { twiSend(LED_DRIVER_ADDR, CMD_WRITE_ENABLE, WRITE_ENABLE_ONCE); //unlock } diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp index 7e24ed43..2db43054 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp @@ -56,7 +56,7 @@ struct Model01Hands { driver::keyboardio::Model01Side Model01Hands::leftHand(0); driver::keyboardio::Model01Side Model01Hands::rightHand(3); -void Model01Hands::setup(void) { +void Model01Hands::setup() { // This lets the keyboard pull up to 1.6 amps from the host. // That violates the USB spec. But it sure is pretty looking DDRE |= _BV(6); @@ -149,7 +149,7 @@ driver::keyboardio::keydata_t Model01KeyScanner::rightHandState; driver::keyboardio::keydata_t Model01KeyScanner::previousLeftHandState; driver::keyboardio::keydata_t Model01KeyScanner::previousRightHandState; -void Model01KeyScanner::enableScannerPower(void) { +void Model01KeyScanner::enableScannerPower() { // Turn on power to the LED net DDRC |= _BV(7); PORTC |= _BV(7); diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp index daecda98..5fb1ae25 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp @@ -44,7 +44,7 @@ struct Model100Hands { driver::keyboardio::Model100Side Model100Hands::leftHand(0); driver::keyboardio::Model100Side Model100Hands::rightHand(3); -void Model100Hands::setup(void) { +void Model100Hands::setup() { Model100KeyScanner::enableScannerPower(); Wire.begin(); Wire.setClock(400000); @@ -123,7 +123,7 @@ driver::keyboardio::keydata_t Model100KeyScanner::rightHandState; driver::keyboardio::keydata_t Model100KeyScanner::previousLeftHandState; driver::keyboardio::keydata_t Model100KeyScanner::previousRightHandState; -void Model100KeyScanner::enableScannerPower(void) { +void Model100KeyScanner::enableScannerPower() { // Turn on the switched 5V network. // make sure this happens at least 100ms after USB connect // to satisfy inrush limits @@ -137,7 +137,7 @@ void Model100KeyScanner::enableScannerPower(void) { digitalWrite(PB15, LOW); } -void Model100KeyScanner::disableScannerPower(void) { +void Model100KeyScanner::disableScannerPower() { // Turn on power to the 5V net // pinMode(PB9, OUTPUT_OPEN_DRAIN); diff --git a/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.cpp b/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.cpp index a3f25ccb..48186cac 100644 --- a/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.cpp +++ b/plugins/Kaleidoscope-HardwareTestMode/src/kaleidoscope/plugin/HardwareTestMode.cpp @@ -53,7 +53,7 @@ void HardwareTestMode::setLeds(cRGB color) { waitForKeypress(); } -void HardwareTestMode::testLeds(void) { +void HardwareTestMode::testLeds() { constexpr cRGB red = CRGB(255, 0, 0); constexpr cRGB blue = CRGB(0, 0, 255); constexpr cRGB green = CRGB(0, 255, 0); diff --git a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.cpp b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.cpp index 2f31cb90..1aed3a3b 100644 --- a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.cpp +++ b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.cpp @@ -107,7 +107,7 @@ cRGB Heatmap::TransientLEDMode::computeColor(float v) { return {b, g, r}; } -void Heatmap::TransientLEDMode::shiftStats(void) { +void Heatmap::TransientLEDMode::shiftStats() { // this method is called when: // 1. a value in heatmap_ reach INT8_MAX // 2. highest_ reach heat_colors_length*512 (see Heatmap::loopHook) @@ -121,7 +121,7 @@ void Heatmap::TransientLEDMode::shiftStats(void) { highest_ = highest_ >> 1; } -void Heatmap::resetMap(void) { +void Heatmap::resetMap() { if (::LEDControl.get_mode_index() != led_mode_id_) return; @@ -210,7 +210,7 @@ EventHandlerResult Heatmap::TransientLEDMode::beforeEachCycle() { return EventHandlerResult::OK; } -void Heatmap::TransientLEDMode::update(void) { +void Heatmap::TransientLEDMode::update() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h index 37a65d0b..618021ed 100644 --- a/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h +++ b/plugins/Kaleidoscope-Heatmap/src/kaleidoscope/plugin/Heatmap.h @@ -37,7 +37,7 @@ class Heatmap : public Plugin, static uint16_t update_delay; static const cRGB *heat_colors; static uint8_t heat_colors_length; - void resetMap(void); + void resetMap(); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult beforeEachCycle(); @@ -64,7 +64,7 @@ class Heatmap : public Plugin, uint16_t highest_; uint16_t last_heatmap_comp_time_; - void shiftStats(void); + void shiftStats(); cRGB computeColor(float v); friend class Heatmap; diff --git a/plugins/Kaleidoscope-HostOS/README.md b/plugins/Kaleidoscope-HostOS/README.md index 77fca3be..9cf97844 100644 --- a/plugins/Kaleidoscope-HostOS/README.md +++ b/plugins/Kaleidoscope-HostOS/README.md @@ -21,7 +21,7 @@ The extension provides a `HostOS` singleton object. #include #include -void someFunction(void) { +void someFunction() { if (HostOS.os() == kaleidoscope::hostos::LINUX) { // do something linux-y } @@ -32,7 +32,7 @@ void someFunction(void) { KALEIDOSCOPE_INIT_PLUGINS(HostOS) -void setup(void) { +void setup() { Kaleidoscope.setup (); } ``` diff --git a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.cpp b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.cpp index 52dd0f2d..2a2fb7e6 100644 --- a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.cpp +++ b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.cpp @@ -26,7 +26,7 @@ namespace kaleidoscope { namespace plugin { -EventHandlerResult HostOS::onSetup(void) { +EventHandlerResult HostOS::onSetup() { if (is_configured_) return EventHandlerResult::OK; diff --git a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h index 7485f018..68f1a045 100644 --- a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h +++ b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h @@ -43,7 +43,7 @@ class HostOS : public kaleidoscope::Plugin { public: EventHandlerResult onSetup(); - hostos::Type os(void) { + hostos::Type os() { return os_; } void os(hostos::Type new_os); diff --git a/plugins/Kaleidoscope-IdleLEDs/README.md b/plugins/Kaleidoscope-IdleLEDs/README.md index d2ab5ad8..853c6b38 100644 --- a/plugins/Kaleidoscope-IdleLEDs/README.md +++ b/plugins/Kaleidoscope-IdleLEDs/README.md @@ -25,7 +25,7 @@ the box, without any further configuration: KALEIDOSCOPE_INIT_PLUGINS(LEDControl, IdleLEDs, LEDEffectRainbowWave); -void setup (void) { +void setup () { Kaleidoscope.setup (); } ``` @@ -54,7 +54,7 @@ KALEIDOSCOPE_INIT_PLUGINS( LEDEffectRainbowWave ); -void setup (void) { +void setup () { Kaleidoscope.setup (); } ``` diff --git a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.cpp b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.cpp index 691b3018..b97b4ad7 100644 --- a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.cpp +++ b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.cpp @@ -52,7 +52,7 @@ cRGB LEDActiveLayerColorEffect::TransientLEDMode::getActiveColor() { return color; } -void LEDActiveLayerColorEffect::TransientLEDMode::onActivate(void) { +void LEDActiveLayerColorEffect::TransientLEDMode::onActivate() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h index 2f8b6f72..9ef51cbc 100644 --- a/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h +++ b/plugins/Kaleidoscope-LED-ActiveLayerColor/src/kaleidoscope/plugin/LED-ActiveLayerColor.h @@ -45,7 +45,7 @@ class LEDActiveLayerColorEffect : public Plugin, explicit TransientLEDMode(const LEDActiveLayerColorEffect *parent); protected: - void onActivate(void) final; + void onActivate() final; void refreshAt(KeyAddr key_addr) final; private: diff --git a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.cpp b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.cpp index 3d2f6e6a..e773f6ff 100644 --- a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.cpp +++ b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.cpp @@ -38,7 +38,7 @@ AlphaSquareEffect::TransientLEDMode::TransientLEDMode(AlphaSquareEffect * /*pare : last_key_left_(Key_NoKey), last_key_right_(Key_NoKey) {} -void AlphaSquareEffect::TransientLEDMode::update(void) { +void AlphaSquareEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h index 4bfd4017..0857a976 100644 --- a/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h +++ b/plugins/Kaleidoscope-LED-AlphaSquare/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h @@ -45,7 +45,7 @@ class AlphaSquareEffect : public Plugin, explicit TransientLEDMode(AlphaSquareEffect *parent); protected: - void update(void) final; + void update() final; void refreshAt(KeyAddr key_addr) final; private: diff --git a/plugins/Kaleidoscope-LED-Palette-Theme/README.md b/plugins/Kaleidoscope-LED-Palette-Theme/README.md index ffe5c00d..12ade2a5 100644 --- a/plugins/Kaleidoscope-LED-Palette-Theme/README.md +++ b/plugins/Kaleidoscope-LED-Palette-Theme/README.md @@ -21,8 +21,8 @@ namespace example { class TestLEDMode : public LEDMode { protected: - void setup(void) final; - void update(void) final; + void setup() final; + void update() final; kaleidoscope::EventHandlerResult onFocusEvent(const char *command); @@ -32,11 +32,11 @@ class TestLEDMode : public LEDMode { uint16_t TestLEDMode::map_base_; -void TestLEDMode::setup(void) { +void TestLEDMode::setup() { map_base_ = LEDPaletteTheme.reserveThemes(1); } -void TestLEDMode::update(void) { +void TestLEDMode::update() { LEDPaletteTheme.updateHandler(map_base_, 0); } diff --git a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.cpp b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.cpp index 4cbad4d0..5dd56185 100644 --- a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.cpp +++ b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.cpp @@ -59,7 +59,7 @@ EventHandlerResult StalkerEffect::onKeyEvent(KeyEvent &event) { return EventHandlerResult::OK; } -void StalkerEffect::TransientLEDMode::update(void) { +void StalkerEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; @@ -111,7 +111,7 @@ cRGB Haunt::compute(uint8_t *step) { } // BlazingTrail -BlazingTrail::BlazingTrail(void) { +BlazingTrail::BlazingTrail() { } constexpr uint8_t hue_start = 50.0 / 360 * 0xff; constexpr uint8_t hue_end = 0; @@ -144,7 +144,7 @@ cRGB BlazingTrail::compute(uint8_t *step) { } // Rainbow -Rainbow::Rainbow(void) { +Rainbow::Rainbow() { } cRGB Rainbow::compute(uint8_t *step) { diff --git a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h index fdea4136..77d1d9f9 100644 --- a/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h +++ b/plugins/Kaleidoscope-LED-Stalker/src/kaleidoscope/plugin/LED-Stalker.h @@ -75,7 +75,7 @@ namespace stalker { class Haunt : public StalkerEffect::ColorComputer { public: explicit Haunt(const cRGB highlight_color); - Haunt(void) + Haunt() : Haunt(CRGB(0x40, 0x80, 0x80)) {} cRGB compute(uint8_t *step) final; @@ -86,14 +86,14 @@ class Haunt : public StalkerEffect::ColorComputer { class BlazingTrail : public StalkerEffect::ColorComputer { public: - BlazingTrail(void); + BlazingTrail(); cRGB compute(uint8_t *step) final; }; class Rainbow : public StalkerEffect::ColorComputer { public: - Rainbow(void); + Rainbow(); cRGB compute(uint8_t *step) final; }; diff --git a/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.cpp b/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.cpp index 25ba2625..1b55ed43 100644 --- a/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.cpp +++ b/plugins/Kaleidoscope-LED-Wavepool/src/kaleidoscope/plugin/LED-Wavepool.cpp @@ -96,7 +96,7 @@ uint8_t WavepoolEffect::TransientLEDMode::wp_rand() { return (Runtime.millisAtCycleStart() / MS_PER_FRAME) + pgm_read_byte((const uint8_t *)offset); } -void WavepoolEffect::TransientLEDMode::update(void) { +void WavepoolEffect::TransientLEDMode::update() { // limit the frame rate; one frame every 64 ms static uint8_t prev_time = 0; diff --git a/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.cpp b/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.cpp index 2efe3c23..e9355082 100644 --- a/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.cpp +++ b/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.cpp @@ -43,7 +43,7 @@ BootGreetingEffect::BootGreetingEffect(KeyAddr key_addr) { user_key_addr = key_addr; } -void BootGreetingEffect::findLed(void) { +void BootGreetingEffect::findLed() { if (user_key_addr.isValid()) { key_addr_ = user_key_addr; done_ = true; diff --git a/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h b/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h index 68646f5d..6a73d77b 100644 --- a/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h +++ b/plugins/Kaleidoscope-LEDEffect-BootGreeting/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h @@ -40,7 +40,7 @@ class BootGreetingEffect : public kaleidoscope::Plugin { EventHandlerResult afterEachCycle(); private: - static void findLed(void); + static void findLed(); static bool done_; static KeyAddr key_addr_; static uint16_t start_time; diff --git a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.cpp b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.cpp index 73f3517f..0cbaf3d8 100644 --- a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.cpp +++ b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.cpp @@ -25,7 +25,7 @@ namespace kaleidoscope { namespace plugin { -void LEDBreatheEffect::TransientLEDMode::update(void) { +void LEDBreatheEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h index 2473404a..fee01ced 100644 --- a/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h +++ b/plugins/Kaleidoscope-LEDEffect-Breathe/src/kaleidoscope/plugin/LEDEffect-Breathe.h @@ -42,7 +42,7 @@ class LEDBreatheEffect : public Plugin, : parent_(parent) {} protected: - void update(void) final; + void update() final; private: const LEDBreatheEffect *parent_; diff --git a/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.cpp b/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.cpp index 877e622a..f071fbe8 100644 --- a/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.cpp +++ b/plugins/Kaleidoscope-LEDEffect-Chase/src/kaleidoscope/plugin/LEDEffect-Chase.cpp @@ -25,7 +25,7 @@ namespace kaleidoscope { namespace plugin { -void LEDChaseEffect::TransientLEDMode::update(void) { +void LEDChaseEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.cpp b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.cpp index a5b60aab..af07d9a7 100644 --- a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.cpp +++ b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.cpp @@ -27,7 +27,7 @@ namespace kaleidoscope { namespace plugin { -void LEDRainbowEffect::TransientLEDMode::update(void) { +void LEDRainbowEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; @@ -58,7 +58,7 @@ void LEDRainbowEffect::update_delay(byte delay) { // --------- -void LEDRainbowWaveEffect::TransientLEDMode::update(void) { +void LEDRainbowWaveEffect::TransientLEDMode::update() { if (!Runtime.has_leds) return; diff --git a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h index 36d1cba6..b2495b59 100644 --- a/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h +++ b/plugins/Kaleidoscope-LEDEffect-Rainbow/src/kaleidoscope/plugin/LEDEffect-Rainbow.h @@ -28,11 +28,11 @@ class LEDRainbowEffect : public Plugin, public LEDModeInterface { public: void brightness(uint8_t); - uint8_t brightness(void) { + uint8_t brightness() { return rainbow_value; } void update_delay(uint8_t); - uint8_t update_delay(void) { + uint8_t update_delay() { return rainbow_update_delay; } @@ -69,11 +69,11 @@ class LEDRainbowEffect : public Plugin, class LEDRainbowWaveEffect : public Plugin, public LEDModeInterface { public: void brightness(uint8_t); - uint8_t brightness(void) { + uint8_t brightness() { return rainbow_value; } void update_delay(uint8_t); - uint8_t update_delay(void) { + uint8_t update_delay() { return rainbow_update_delay; } diff --git a/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.cpp b/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.cpp index c9c53f75..7107bfcd 100644 --- a/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.cpp +++ b/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.cpp @@ -23,7 +23,7 @@ namespace kaleidoscope { namespace plugin { -void LEDSolidColor::TransientLEDMode::onActivate(void) { +void LEDSolidColor::TransientLEDMode::onActivate() { ::LEDControl.set_all_leds_to(parent_->r_, parent_->g_, parent_->b_); diff --git a/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.h b/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.h index 61bf95dd..7ac5c392 100644 --- a/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.h +++ b/plugins/Kaleidoscope-LEDEffect-SolidColor/src/kaleidoscope/plugin/LEDEffect-SolidColor.h @@ -43,7 +43,7 @@ class LEDSolidColor : public Plugin, : parent_(parent) {} protected: - void onActivate(void) final; + void onActivate() final; void refreshAt(KeyAddr key_addr) final; private: diff --git a/plugins/Kaleidoscope-LEDEffects/README.md b/plugins/Kaleidoscope-LEDEffects/README.md index 8adea278..c5d29d86 100644 --- a/plugins/Kaleidoscope-LEDEffects/README.md +++ b/plugins/Kaleidoscope-LEDEffects/README.md @@ -15,7 +15,7 @@ them. KALEIDOSCOPE_INIT_PLUGINS(LEDControl, JukeBoxEffect); -void setup(void) { +void setup() { Kaleidoscope.setup(); } ``` diff --git a/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.cpp b/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.cpp index 09a3842d..324361bf 100644 --- a/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.cpp +++ b/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.cpp @@ -32,7 +32,7 @@ TriColor::TriColor(cRGB base_color, cRGB mod_color, cRGB esc_color) { esc_color_ = esc_color; } -void TriColor::TransientLEDMode::update(void) { +void TriColor::TransientLEDMode::update() { for (auto key_addr : KeyAddr::all()) { Key k = Layer.lookupOnActiveLayer(key_addr); diff --git a/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.h b/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.h index 02b74318..70da4c39 100644 --- a/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.h +++ b/plugins/Kaleidoscope-LEDEffects/src/kaleidoscope/plugin/TriColor.h @@ -43,7 +43,7 @@ class TriColor : public Plugin, : parent_(parent) {} protected: - void update(void) final; + void update() final; private: const TriColor *parent_; diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp index 7f885f69..6438be2d 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.cpp @@ -47,7 +47,7 @@ uint16_t Leader::time_out = 1000; #define isActive() (sequence_[0] != Key_NoKey) // --- actions --- -int8_t Leader::lookup(void) { +int8_t Leader::lookup() { bool match; for (uint8_t seq_index = 0;; seq_index++) { @@ -82,7 +82,7 @@ int8_t Leader::lookup(void) { // --- api --- -void Leader::reset(void) { +void Leader::reset() { sequence_pos_ = 0; sequence_[0] = Key_NoKey; } diff --git a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h index b1ff9e03..d4de0447 100644 --- a/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h +++ b/plugins/Kaleidoscope-Leader/src/kaleidoscope/plugin/Leader.h @@ -69,7 +69,7 @@ class Leader : public kaleidoscope::Plugin { const dictionary_t *dictionary; - void reset(void); + void reset(); #ifndef NDEPRECATED DEPRECATED(LEADER_TIME_OUT) @@ -100,7 +100,7 @@ class Leader : public kaleidoscope::Plugin { uint16_t start_time_ = 0; uint16_t timeout_ = 1000; - int8_t lookup(void); + int8_t lookup(); }; } // namespace plugin diff --git a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.cpp b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.cpp index 551e3b61..ab8c291e 100644 --- a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.cpp +++ b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.cpp @@ -91,7 +91,7 @@ EventHandlerResult MouseKeys::onNameQuery() { } // ----------------------------------------------------------------------------- -EventHandlerResult MouseKeys::onSetup(void) { +EventHandlerResult MouseKeys::onSetup() { kaleidoscope::Runtime.hid().mouse().setup(); kaleidoscope::Runtime.hid().absoluteMouse().setup(); diff --git a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.cpp b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.cpp index 93fc335a..793f88e5 100644 --- a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.cpp +++ b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.cpp @@ -38,11 +38,11 @@ uint8_t NumPad::lock_hue = 170; KeyAddr NumPad::numpadLayerToggleKeyAddr; bool NumPad::numpadActive = false; -EventHandlerResult NumPad::onSetup(void) { +EventHandlerResult NumPad::onSetup() { return EventHandlerResult::OK; } -void NumPad::setKeyboardLEDColors(void) { +void NumPad::setKeyboardLEDColors() { ::LEDControl.set_mode(::LEDControl.get_mode_index()); for (auto key_addr : KeyAddr::all()) { diff --git a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h index b4792200..1c594a75 100644 --- a/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h +++ b/plugins/Kaleidoscope-NumPad/src/kaleidoscope/plugin/NumPad.h @@ -32,11 +32,11 @@ class NumPad : public kaleidoscope::Plugin { static cRGB color; static uint8_t lock_hue; - EventHandlerResult onSetup(void); + EventHandlerResult onSetup(); EventHandlerResult afterEachCycle(); private: - void setKeyboardLEDColors(void); + void setKeyboardLEDColors(); static KeyAddr numpadLayerToggleKeyAddr; static bool numpadActive; diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h index 4ed35a64..224c1240 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.h @@ -72,7 +72,7 @@ class SpaceCadet : public kaleidoscope::Plugin { } }; - SpaceCadet(void); + SpaceCadet(); // Methods void enable() { diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp index 8b0bcdec..149d1b9e 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp @@ -32,13 +32,13 @@ namespace kaleidoscope { namespace plugin { // --- api --- -void Syster::reset(void) { +void Syster::reset() { symbol_pos_ = 0; symbol_[0] = 0; is_active_ = false; } -bool Syster::is_active(void) { +bool Syster::is_active() { return is_active_; } diff --git a/plugins/Kaleidoscope-TypingBreaks/README.md b/plugins/Kaleidoscope-TypingBreaks/README.md index 8a5ed733..10a73841 100644 --- a/plugins/Kaleidoscope-TypingBreaks/README.md +++ b/plugins/Kaleidoscope-TypingBreaks/README.md @@ -24,7 +24,7 @@ the box, without any further configuration: KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, TypingBreaks); -void setup (void) { +void setup () { Kaleidoscope.setup (); TypingBreaks.settings.idle_time_limit = 60; diff --git a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp index 5feaa72e..bcb78bd7 100644 --- a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp +++ b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp @@ -32,7 +32,7 @@ namespace plugin { uint8_t Unicode::input_delay_; Key Unicode::linux_key_ = Key_U; -void Unicode::start(void) { +void Unicode::start() { switch (::HostOS.os()) { case hostos::LINUX: kaleidoscope::Runtime.hid().keyboard().pressRawKey(Key_LeftControl); @@ -61,7 +61,7 @@ void Unicode::start(void) { } } -void Unicode::input(void) { +void Unicode::input() { switch (::HostOS.os()) { case hostos::LINUX: break; @@ -76,7 +76,7 @@ void Unicode::input(void) { delay(input_delay_); } -void Unicode::end(void) { +void Unicode::end() { switch (::HostOS.os()) { case hostos::LINUX: kaleidoscope::Runtime.hid().keyboard().pressRawKey(Key_Spacebar); @@ -193,13 +193,13 @@ __attribute__((weak)) Key hexToKeysWithNumpad(uint8_t hex) { return {m, KEY_FLAGS}; } -__attribute__((weak)) void unicodeCustomStart(void) { +__attribute__((weak)) void unicodeCustomStart() { } -__attribute__((weak)) void unicodeCustomEnd(void) { +__attribute__((weak)) void unicodeCustomEnd() { } -__attribute__((weak)) void unicodeCustomInput(void) { +__attribute__((weak)) void unicodeCustomInput() { } kaleidoscope::plugin::Unicode Unicode; diff --git a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h index a68849a7..e0a1b600 100644 --- a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h +++ b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.h @@ -26,9 +26,9 @@ namespace kaleidoscope { namespace plugin { class Unicode : public kaleidoscope::Plugin { public: - static void start(void); - static void input(void); - static void end(void); + static void start(); + static void input(); + static void end(); static void type(uint32_t unicode); static void typeCode(uint32_t unicode); @@ -58,8 +58,8 @@ class Unicode : public kaleidoscope::Plugin { Key hexToKey(uint8_t hex); Key hexToKeysWithNumpad(uint8_t hex); -void unicodeCustomStart(void); -void unicodeCustomEnd(void); -void unicodeCustomInput(void); +void unicodeCustomStart(); +void unicodeCustomEnd(); +void unicodeCustomInput(); extern kaleidoscope::plugin::Unicode Unicode; From d34f63e4eb2b7f0f8b8804f5f04e4608357e833d Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Wed, 1 Jun 2022 22:02:25 -0500 Subject: [PATCH 6/8] Change private type names to conform to style guide Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/EEPROM-Settings.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h index 32bb5363..efcc236a 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h @@ -25,6 +25,14 @@ namespace kaleidoscope { namespace plugin { class EEPROMSettings : public kaleidoscope::Plugin { + private: + struct Settings { + uint8_t default_layer : 7; + bool ignore_hardcoded_layers : 1; + uint8_t version; + uint16_t crc; + }; + public: EventHandlerResult onSetup(); EventHandlerResult beforeEachCycle(); @@ -67,16 +75,11 @@ class EEPROMSettings : public kaleidoscope::Plugin { private: static constexpr uint8_t IGNORE_HARDCODED_LAYER = 0x7e; - uint16_t next_start_ = sizeof(EEPROMSettings::settings); + uint16_t next_start_ = sizeof(EEPROMSettings::Settings); bool is_valid_; bool sealed_; - struct settings { - uint8_t default_layer : 7; - bool ignore_hardcoded_layers : 1; - uint8_t version; - uint16_t crc; - } settings_; + Settings settings_; }; class FocusSettingsCommand : public kaleidoscope::Plugin { From 396b4220f2eaaa9b9b628e75a6fd574bc20b81c8 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sun, 29 May 2022 22:26:41 -0500 Subject: [PATCH 7/8] Update header includes and format code Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/AutoShiftConfig.cpp | 2 +- .../src/kaleidoscope/plugin/EEPROM-Settings.h | 2 ++ .../src/kaleidoscope/plugin/Escape-OneShot-Config.cpp | 1 - .../src/kaleidoscope/plugin/Escape-OneShot.cpp | 2 +- .../src/kaleidoscope/plugin/Escape-OneShot.h | 6 ++---- .../src/kaleidoscope/plugin/FocusSerial.cpp | 1 - .../src/kaleidoscope/plugin/MagicCombo.h | 4 ++-- .../src/kaleidoscope/plugin/PersistentLEDMode.cpp | 3 ++- .../src/kaleidoscope/plugin/PersistentLEDMode.h | 2 +- .../src/kaleidoscope/plugin/SpaceCadet.cpp | 2 +- .../Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp | 2 +- .../Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h | 2 +- .../src/kaleidoscope/plugin/TapDance.cpp | 2 +- plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h | 2 +- 14 files changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp index bf115317..d2839b96 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp @@ -20,7 +20,7 @@ #include // for PSTR, strcmp_P, strncmp_P #include // for EEPROMSettings #include // for Focus, FocusSerial -#include // for uint16_t, uint8_t +#include // for uint8_t, uint16_t #include "kaleidoscope/Runtime.h" // for Runtime, Runtime_ #include "kaleidoscope/device/device.h" // for VirtualProps::Storage, Base<>::Storage diff --git a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h index efcc236a..f08b5d1c 100644 --- a/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h +++ b/plugins/Kaleidoscope-EEPROM-Settings/src/kaleidoscope/plugin/EEPROM-Settings.h @@ -24,6 +24,7 @@ namespace kaleidoscope { namespace plugin { + class EEPROMSettings : public kaleidoscope::Plugin { private: struct Settings { @@ -75,6 +76,7 @@ class EEPROMSettings : public kaleidoscope::Plugin { private: static constexpr uint8_t IGNORE_HARDCODED_LAYER = 0x7e; + uint16_t next_start_ = sizeof(EEPROMSettings::Settings); bool is_valid_; bool sealed_; diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp index 405c037a..1ef9dc27 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot-Config.cpp @@ -20,7 +20,6 @@ #include // for PSTR, F, __FlashStringHelper, strcmp_P #include // for EEPROMSettings #include // for Focus, FocusSerial -#include // for uint16_t #include "kaleidoscope/Runtime.h" // for Runtime, Runtime_ #include "kaleidoscope/device/device.h" // for VirtualProps::Storage, Base<>::Storage diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp index d5cc1e41..4e035376 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.cpp @@ -21,7 +21,7 @@ #include "kaleidoscope/KeyEvent.h" // for KeyEvent #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult, EventHandlerResult::E... -#include "kaleidoscope/key_defs.h" // for Key, Key_Escape, Key_NoKey +#include "kaleidoscope/key_defs.h" // for Key, Key_NoKey #include "kaleidoscope/keyswitch_state.h" // for keyIsInjected, keyToggledOn namespace kaleidoscope { diff --git a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h index 8a2b4b35..b5d582cb 100644 --- a/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h +++ b/plugins/Kaleidoscope-Escape-OneShot/src/kaleidoscope/plugin/Escape-OneShot.h @@ -22,7 +22,7 @@ #include "kaleidoscope/KeyEvent.h" // for KeyEvent #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult -#include "kaleidoscope/key_defs.h" // for Key +#include "kaleidoscope/key_defs.h" // for Key, Key_Escape #include "kaleidoscope/plugin.h" // for Plugin // DEPRECATED: `OneShotCancelKey` doesn't match our normal naming, and should @@ -50,9 +50,7 @@ class EscapeOneShot : public kaleidoscope::Plugin { struct Settings { Key cancel_oneshot_key; }; - Settings settings_ = { - .cancel_oneshot_key = Key_Escape - }; + Settings settings_ = {.cancel_oneshot_key = Key_Escape}; }; class EscapeOneShotConfig : public Plugin { diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp index db1ae9cd..6f81fa1e 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp @@ -19,7 +19,6 @@ #include // for PSTR, __FlashStringHelper, F, strcmp_P #include // for HardwareSerial -#include // for uint8_t #include // for memset #include "kaleidoscope/Runtime.h" // for Runtime, Runtime_ diff --git a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h index 696f0642..f5bb5400 100644 --- a/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h +++ b/plugins/Kaleidoscope-MagicCombo/src/kaleidoscope/plugin/MagicCombo.h @@ -88,15 +88,15 @@ class MagicCombo : public kaleidoscope::Plugin { EventHandlerResult afterEachCycle(); private: - uint16_t start_time_ = 0; + uint16_t start_time_ = 0; uint16_t min_interval_ = 500; }; namespace magiccombo { extern const MagicCombo::Combo combos[]; extern const uint8_t combos_length; - } // namespace magiccombo + } // namespace plugin } // namespace kaleidoscope diff --git a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp index be2d4f17..a093d2cc 100644 --- a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp +++ b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp @@ -18,8 +18,9 @@ #include "kaleidoscope/plugin/PersistentLEDMode.h" +#include // for PSTR, strcmp_P, F, __FlashStringHelper #include // for EEPROMSettings -#include // for Focus +#include // for Focus, FocusSerial #include // for uint8_t, uint16_t #include "kaleidoscope/Runtime.h" // for Runtime, Runtime_ diff --git a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h index 59cf9706..85a70fa4 100644 --- a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h +++ b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.h @@ -18,7 +18,7 @@ #pragma once -#include // for uint16_t, uint8_t +#include // for uint8_t, uint16_t #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/plugin.h" // for Plugin diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp index a38fffe3..9c43b72e 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadet.cpp @@ -162,7 +162,7 @@ EventHandlerResult SpaceCadet::afterEachCycle() { if (event_queue_.isEmpty()) return EventHandlerResult::OK; - // Get timeout value for the pending key. + // Get timeout value for the pending key. #ifndef NDEPRECATED #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp index 149d1b9e..1d8e2454 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.cpp @@ -19,7 +19,7 @@ #include // for F, __FlashStringHelper #include // for Focus, FocusSerial -#include // for int8_t, uint8_t +#include // for int8_t #include "kaleidoscope/KeyAddr.h" // for KeyAddr #include "kaleidoscope/KeyEvent.h" // for KeyEvent diff --git a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h index 39e1a79c..b29218c5 100644 --- a/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h +++ b/plugins/Kaleidoscope-Syster/src/kaleidoscope/plugin/Syster.h @@ -18,7 +18,7 @@ #pragma once #include // for SYSTER -#include // for int8_t, uint8_t +#include // for uint8_t, int8_t #include "kaleidoscope/KeyEvent.h" // for KeyEvent #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult diff --git a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp index 14cbe932..999485b0 100644 --- a/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp +++ b/plugins/Kaleidoscope-TapDance/src/kaleidoscope/plugin/TapDance.cpp @@ -38,7 +38,7 @@ namespace plugin { // --- config --- #ifndef NDEPRECATED -uint16_t TapDance::time_out = 200; +uint16_t TapDance::time_out = 200; #endif // --- api --- diff --git a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h index 918d7779..c05c64d7 100644 --- a/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h +++ b/plugins/Kaleidoscope-Turbo/src/kaleidoscope/plugin/Turbo.h @@ -21,7 +21,7 @@ #include // for uint16_t, uint32_t #include "kaleidoscope/KeyEvent.h" // for KeyEvent -#include "kaleidoscope/device/device.h" // for cRGB +#include "kaleidoscope/device/device.h" // for cRGB, CRGB #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/key_defs.h" // for Key #include "kaleidoscope/plugin.h" // for Plugin From 274ff5eb7600e71e027e9d6fe28bb77386a16a25 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Thu, 2 Jun 2022 00:10:08 -0500 Subject: [PATCH 8/8] Address spurious cpplint complaints Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/DynamicTapDance.h | 2 +- .../src/kaleidoscope/device/ez/ErgoDox.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h index 86cc1f4c..f5255788 100644 --- a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h +++ b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.h @@ -41,7 +41,7 @@ class DynamicTapDance : public kaleidoscope::Plugin { uint16_t storage_base_; uint16_t storage_size_; static constexpr uint8_t reserved_tap_dance_key_count_ = ranges::TD_LAST - ranges::TD_FIRST + 1; - uint16_t map_[reserved_tap_dance_key_count_]; + uint16_t map_[reserved_tap_dance_key_count_]; // NOLINT(runtime/arrays) uint8_t dance_count_; uint8_t offset_; void updateDynamicTapDanceCache(); diff --git a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h index 692b4bc9..f7532e76 100644 --- a/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h +++ b/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h @@ -82,8 +82,8 @@ class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard { private: ErgoDoxScanner scanner_; - uint8_t previousKeyState_[matrix_rows]; - uint8_t keyState_[matrix_rows]; + uint8_t previousKeyState_[matrix_rows]; // NOLINT(runtime/arrays) + uint8_t keyState_[matrix_rows]; // NOLINT(runtime/arrays) uint8_t debounce_matrix_[matrix_rows][matrix_columns]; uint8_t debounceMaskForRow(uint8_t row);