From 3865bd8793f73e079228f63e5f925981166496b6 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 3 Jun 2017 22:51:34 -0700 Subject: [PATCH] astyle with current project style guidelines --- examples/LEDEffects/LEDEffects.ino | 48 +++++++++++----------- src/Kaleidoscope/Jukebox.cpp | 12 +++--- src/Kaleidoscope/Miami.cpp | 4 +- src/Kaleidoscope/TriColor.cpp | 66 +++++++++++++++--------------- src/Kaleidoscope/TriColor.h | 16 ++++---- 5 files changed, 73 insertions(+), 73 deletions(-) diff --git a/examples/LEDEffects/LEDEffects.ino b/examples/LEDEffects/LEDEffects.ino index 4de34453..41a1e765 100644 --- a/examples/LEDEffects/LEDEffects.ino +++ b/examples/LEDEffects/LEDEffects.ino @@ -23,34 +23,34 @@ 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 () { - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL); +void setup() { + Kaleidoscope.setup(KEYMAP_SIZE); + Kaleidoscope.use(&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL); - MiamiEffect.activate (); + MiamiEffect.activate(); } -void loop () { - Kaleidoscope.loop (); +void loop() { + Kaleidoscope.loop(); } diff --git a/src/Kaleidoscope/Jukebox.cpp b/src/Kaleidoscope/Jukebox.cpp index 21409fcb..d6b1a101 100644 --- a/src/Kaleidoscope/Jukebox.cpp +++ b/src/Kaleidoscope/Jukebox.cpp @@ -19,21 +19,21 @@ #include KaleidoscopePlugins::LEDEffects::TriColor JukeboxEffect((cRGB) { - 0xc8, 0xe8, 0xee + 0xc8, 0xe8, 0xee } /* TM */, (cRGB) { - 0xc3, 0xee, 0x8c + 0xc3, 0xee, 0x8c } /* VCO */, (cRGB) { - 0x21, 0x38, 0xd7 + 0x21, 0x38, 0xd7 } /* RN */); KaleidoscopePlugins::LEDEffects::TriColor JukeboxAlternateEffect((cRGB) { - 0xc8, 0xe8, 0xee + 0xc8, 0xe8, 0xee } /* TM */, (cRGB) { - 0x21, 0x38, 0xd7 + 0x21, 0x38, 0xd7 } /* RN */, (cRGB) { - 0xc3, 0xee, 0x8c + 0xc3, 0xee, 0x8c } /* VCO */); diff --git a/src/Kaleidoscope/Miami.cpp b/src/Kaleidoscope/Miami.cpp index c6be90de..217500ad 100644 --- a/src/Kaleidoscope/Miami.cpp +++ b/src/Kaleidoscope/Miami.cpp @@ -19,8 +19,8 @@ #include KaleidoscopePlugins::LEDEffects::TriColor MiamiEffect((cRGB) { - 0xd6, 0xd6, 0x4e + 0xd6, 0xd6, 0x4e } /* Cyan */, (cRGB) { - 0xaf, 0x67, 0xfa + 0xaf, 0x67, 0xfa } /* Magenta */); diff --git a/src/Kaleidoscope/TriColor.cpp b/src/Kaleidoscope/TriColor.cpp index 406687a6..5bc7a1de 100644 --- a/src/Kaleidoscope/TriColor.cpp +++ b/src/Kaleidoscope/TriColor.cpp @@ -21,43 +21,43 @@ namespace KaleidoscopePlugins { namespace LEDEffects { -TriColor::TriColor (cRGB baseColor, cRGB modColor, cRGB escColor) { - this->baseColor = baseColor; - this->modColor = modColor; - this->escColor = escColor; +TriColor::TriColor(cRGB baseColor, cRGB modColor, cRGB escColor) { + this->baseColor = baseColor; + this->modColor = modColor; + this->escColor = escColor; } void -TriColor::update (void) { - for (uint8_t r = 0; r < ROWS; r++) { - for (uint8_t c = 0; c < COLS; c++) { - Key k = Layer.lookup (r, c); - - // Special keys are always modColor - if (k.flags != 0) { - LEDControl.led_set_crgb_at (r, c, modColor); - continue; - } - - cRGB color = modColor; - - switch (k.keyCode) { - case Key_A.keyCode ... Key_0.keyCode: - case Key_Spacebar.keyCode: - case Key_KeypadSubtract.keyCode ... Key_KeypadDivide.keyCode: - case Key_Keypad1.keyCode ... Key_KeypadDot.keyCode: - case Key_F1.keyCode ... Key_F4.keyCode: - case Key_F9.keyCode ... Key_F12.keyCode: - color = baseColor; - break; - case Key_Escape.keyCode: - color = escColor; - break; - } - - LEDControl.led_set_crgb_at (r, c, color); - } +TriColor::update(void) { + for (uint8_t r = 0; r < ROWS; r++) { + for (uint8_t c = 0; c < COLS; c++) { + Key k = Layer.lookup(r, c); + + // Special keys are always modColor + if (k.flags != 0) { + LEDControl.led_set_crgb_at(r, c, modColor); + continue; + } + + cRGB color = modColor; + + switch (k.keyCode) { + case Key_A.keyCode ... Key_0.keyCode: + case Key_Spacebar.keyCode: + case Key_KeypadSubtract.keyCode ... Key_KeypadDivide.keyCode: + case Key_Keypad1.keyCode ... Key_KeypadDot.keyCode: + case Key_F1.keyCode ... Key_F4.keyCode: + case Key_F9.keyCode ... Key_F12.keyCode: + color = baseColor; + break; + case Key_Escape.keyCode: + color = escColor; + break; + } + + LEDControl.led_set_crgb_at(r, c, color); } + } } }; }; diff --git a/src/Kaleidoscope/TriColor.h b/src/Kaleidoscope/TriColor.h index b30317f1..b7cc0774 100644 --- a/src/Kaleidoscope/TriColor.h +++ b/src/Kaleidoscope/TriColor.h @@ -24,16 +24,16 @@ namespace KaleidoscopePlugins { namespace LEDEffects { class TriColor : public LEDMode { - public: - TriColor (cRGB baseColor, cRGB modColor, cRGB escColor); - TriColor (cRGB baseColor, cRGB modColor) : TriColor (baseColor, modColor, modColor) {}; + public: + TriColor(cRGB baseColor, cRGB modColor, cRGB escColor); + TriColor(cRGB baseColor, cRGB modColor) : TriColor(baseColor, modColor, modColor) {}; - virtual void update (void) final; + virtual void update(void) final; - private: - cRGB baseColor; - cRGB modColor; - cRGB escColor; + private: + cRGB baseColor; + cRGB modColor; + cRGB escColor; }; }; };