From cfd80f3f69b5149e892d7e591f00db66a9cdf0a0 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 3 Jun 2017 10:34:48 +0200 Subject: [PATCH] Conform to the latest Kaleidoscope Style Guide Signed-off-by: Gergely Nagy --- README.md | 10 ++++---- examples/Colormap/Colormap.ino | 42 +++++++++++++++++----------------- src/Kaleidoscope/Colormap.cpp | 26 ++++++++++----------- src/Kaleidoscope/Colormap.h | 18 +++++++-------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index ee24d6c7..36603281 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,12 @@ register the `Focus` hooks, and it will do the rest. #include void setup(void) { - Kaleidoscope.setup(); - USE_PLUGINS(&ColormapEffect, &Focus); + Kaleidoscope.setup(); + USE_PLUGINS(&ColormapEffect, &Focus); - ColormapEffect.max_layers(1); - Focus.addHook(FOCUS_HOOK_LEDPALETTETHEME); - Focus.addHook(FOCUS_HOOK_COLORMAP); + ColormapEffect.max_layers(1); + Focus.addHook(FOCUS_HOOK_LEDPALETTETHEME); + Focus.addHook(FOCUS_HOOK_COLORMAP); } ``` diff --git a/examples/Colormap/Colormap.ino b/examples/Colormap/Colormap.ino index 392424e9..f9dc42db 100644 --- a/examples/Colormap/Colormap.ino +++ b/examples/Colormap/Colormap.ino @@ -20,32 +20,32 @@ #include const Key keymaps[][ROWS][COLS] PROGMEM = { - [0] = KEYMAP_STACKED - (Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, - Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, - Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, - Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, - - Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, - Key_NoKey, - - Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, - Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, - Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, - Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, - - Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, - Key_NoKey), + [0] = KEYMAP_STACKED + (Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, + Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, + Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, + Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, + + Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, + Key_NoKey, + + Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, + Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, + Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, + Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, + + Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, + Key_NoKey), }; void setup() { - USE_PLUGINS(&ColormapEffect); + USE_PLUGINS(&ColormapEffect); - Kaleidoscope.setup(); - ColormapEffect.max_layers(1); - ColormapEffect.activate(); + Kaleidoscope.setup(); + ColormapEffect.max_layers(1); + ColormapEffect.activate(); } void loop() { - Kaleidoscope.loop(); + Kaleidoscope.loop(); } diff --git a/src/Kaleidoscope/Colormap.cpp b/src/Kaleidoscope/Colormap.cpp index e0428d5c..4a0699a9 100644 --- a/src/Kaleidoscope/Colormap.cpp +++ b/src/Kaleidoscope/Colormap.cpp @@ -33,31 +33,31 @@ ColormapEffect::ColormapEffect(void) { } void ColormapEffect::begin(void) { - LEDMode::begin(); + LEDMode::begin(); - USE_PLUGINS(&::EEPROMSettings, &::LEDPaletteTheme); + USE_PLUGINS(&::EEPROMSettings, &::LEDPaletteTheme); } void ColormapEffect::max_layers(uint8_t max_) { - if (map_base_ != 0) - return; + if (map_base_ != 0) + return; - max_layers_ = max_; - map_base_ = ::LEDPaletteTheme.reserveThemes(max_layers_); + max_layers_ = max_; + map_base_ = ::LEDPaletteTheme.reserveThemes(max_layers_); } void ColormapEffect::update(void) { - for (uint8_t l = 0; l < 32; l++) { - if (!Layer.isOn(l)) - continue; + for (uint8_t l = 0; l < 32; l++) { + if (!Layer.isOn(l)) + continue; - ::LEDPaletteTheme.update(map_base_, l); - } + ::LEDPaletteTheme.update(map_base_, l); + } } bool ColormapEffect::focusHook(const char *command) { - return ::LEDPaletteTheme.themeFocusHandler(command, PSTR("colormap.map"), - map_base_, max_layers_); + return ::LEDPaletteTheme.themeFocusHandler(command, PSTR("colormap.map"), + map_base_, max_layers_); } } diff --git a/src/Kaleidoscope/Colormap.h b/src/Kaleidoscope/Colormap.h index 6abc699d..918736fa 100644 --- a/src/Kaleidoscope/Colormap.h +++ b/src/Kaleidoscope/Colormap.h @@ -23,19 +23,19 @@ namespace kaleidoscope { class ColormapEffect : public LEDMode { - public: - ColormapEffect(void); + public: + ColormapEffect(void); - void begin(void) final; - void update(void) final; + void begin(void) final; + void update(void) final; - void max_layers(uint8_t max_); + void max_layers(uint8_t max_); - static bool focusHook(const char *command); + static bool focusHook(const char *command); - private: - static uint8_t max_layers_; - static uint16_t map_base_; + private: + static uint8_t max_layers_; + static uint16_t map_base_; }; }