From 1f8fc546e55c62641c900eaa611eabf3fa3456ef Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 26 May 2017 16:20:22 -0700 Subject: [PATCH] make astyle --- .../LED-ActiveModColor/LED-ActiveModColor.ino | 44 +++++++------- src/Kaleidoscope/LED-ActiveModColor.cpp | 58 ++++++++++--------- src/Kaleidoscope/LED-ActiveModColor.h | 22 +++---- 3 files changed, 63 insertions(+), 61 deletions(-) diff --git a/examples/LED-ActiveModColor/LED-ActiveModColor.ino b/examples/LED-ActiveModColor/LED-ActiveModColor.ino index f52a712a..384279f9 100644 --- a/examples/LED-ActiveModColor/LED-ActiveModColor.ino +++ b/examples/LED-ActiveModColor/LED-ActiveModColor.ino @@ -20,33 +20,33 @@ #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_skip, - - 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_skip - ), + [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_skip, + + 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_skip + ), }; void setup () { - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&LEDControl, &ActiveModColorEffect, NULL); + Kaleidoscope.setup (KEYMAP_SIZE); + Kaleidoscope.use (&LEDControl, &ActiveModColorEffect, NULL); - ActiveModColorEffect.configure ({0x00, 0xff, 0xff}); + ActiveModColorEffect.configure ({0x00, 0xff, 0xff}); } void loop () { - Kaleidoscope.loop (); + Kaleidoscope.loop (); } diff --git a/src/Kaleidoscope/LED-ActiveModColor.cpp b/src/Kaleidoscope/LED-ActiveModColor.cpp index e7ed8f10..d9d0d77b 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.cpp +++ b/src/Kaleidoscope/LED-ActiveModColor.cpp @@ -20,47 +20,49 @@ #include namespace KaleidoscopePlugins { - namespace LEDEffects { - cRGB ActiveModColorEffect::highlightColor = (cRGB) {0xff, 0xff, 0xff}; +namespace LEDEffects { +cRGB ActiveModColorEffect::highlightColor = (cRGB) { + 0xff, 0xff, 0xff +}; - ActiveModColorEffect::ActiveModColorEffect (void) { - } +ActiveModColorEffect::ActiveModColorEffect (void) { +} - void - ActiveModColorEffect::begin (void) { - loop_hook_use (loopHook); - } +void +ActiveModColorEffect::begin (void) { + loop_hook_use (loopHook); +} - void - ActiveModColorEffect::configure (const cRGB highlightColor_) { - highlightColor = highlightColor_; - } +void +ActiveModColorEffect::configure (const cRGB highlightColor_) { + highlightColor = highlightColor_; +} - void - ActiveModColorEffect::loopHook (bool postClear) { - if (postClear) +void +ActiveModColorEffect::loopHook (bool postClear) { + if (postClear) return; - for (byte r = 0; r < ROWS; r++) { + for (byte r = 0; r < ROWS; r++) { for (byte c = 0; c < COLS; c++) { - Key k = Layer.lookup (r, c); + Key k = Layer.lookup (r, c); - if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) { - uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST; - k.flags = 0; - k.keyCode = Key_LeftControl.keyCode + idx; - } + if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) { + uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST; + k.flags = 0; + k.keyCode = Key_LeftControl.keyCode + idx; + } - if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw) - continue; + if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw) + continue; - if (Keyboard.isModifierActive (k.keyCode)) - LEDControl.led_set_crgb_at (r, c, highlightColor); + if (Keyboard.isModifierActive (k.keyCode)) + LEDControl.led_set_crgb_at (r, c, highlightColor); } - } } +} - }; +}; }; KaleidoscopePlugins::LEDEffects::ActiveModColorEffect ActiveModColorEffect; diff --git a/src/Kaleidoscope/LED-ActiveModColor.h b/src/Kaleidoscope/LED-ActiveModColor.h index ee6abbde..fca1f9c1 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.h +++ b/src/Kaleidoscope/LED-ActiveModColor.h @@ -20,19 +20,19 @@ #include namespace KaleidoscopePlugins { - namespace LEDEffects { - class ActiveModColorEffect : public KaleidoscopePlugin { - public: - ActiveModColorEffect (void); +namespace LEDEffects { +class ActiveModColorEffect : public KaleidoscopePlugin { + public: + ActiveModColorEffect (void); - static void configure (const cRGB highlightColor); - virtual void begin (void) final; + static void configure (const cRGB highlightColor); + virtual void begin (void) final; - private: - static cRGB highlightColor; - static void loopHook (bool postClear); - }; - }; + private: + static cRGB highlightColor; + static void loopHook (bool postClear); +}; +}; }; extern KaleidoscopePlugins::LEDEffects::ActiveModColorEffect ActiveModColorEffect;