From d515f0088b5520e3ea0c6228744dec78e61b8e0f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 3 Jun 2017 23:32:58 -0700 Subject: [PATCH] Make the linter happy --- examples/LED-AlphaSquare/LED-AlphaSquare.ino | 7 +- src/Kaleidoscope/AlphaSquare-Effect.h | 4 +- src/Kaleidoscope/LED-AlphaSquare.cpp | 72 ++++++++++---------- src/Kaleidoscope/LED-AlphaSquare.h | 28 ++++---- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/examples/LED-AlphaSquare/LED-AlphaSquare.ino b/examples/LED-AlphaSquare/LED-AlphaSquare.ino index 9324d4d4..94553ba9 100644 --- a/examples/LED-AlphaSquare/LED-AlphaSquare.ino +++ b/examples/LED-AlphaSquare/LED-AlphaSquare.ino @@ -38,8 +38,7 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, - Key_skip - ), + Key_skip), }; const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { @@ -72,12 +71,14 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { LEDControl.set_all_leds_to(0, 0, 0); LEDControl.led_sync(); delay(100); + for (uint8_t step = 0; step <= 0xf0; step += 8) { AlphaSquare.color = { step, step, step }; AlphaSquare.display(KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 2); AlphaSquare.display(KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 10); delay(10); } + for (uint8_t step = 0xff; step >= 8; step -= 8) { AlphaSquare.color = { step, step, step }; AlphaSquare.display(KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 2); @@ -85,8 +86,8 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { delay(10); } delay(100); - } + LEDControl.set_all_leds_to(0, 0, 0); return MACRO_NONE; diff --git a/src/Kaleidoscope/AlphaSquare-Effect.h b/src/Kaleidoscope/AlphaSquare-Effect.h index 66179084..f4426bfa 100644 --- a/src/Kaleidoscope/AlphaSquare-Effect.h +++ b/src/Kaleidoscope/AlphaSquare-Effect.h @@ -27,8 +27,8 @@ class AlphaSquareEffect : public LEDMode { public: AlphaSquareEffect(void); - virtual void begin(void) final; - virtual void update(void) final; + void begin(void) final; + void update(void) final; static uint16_t length; private: diff --git a/src/Kaleidoscope/LED-AlphaSquare.cpp b/src/Kaleidoscope/LED-AlphaSquare.cpp index 903a2eb2..df8c2173 100644 --- a/src/Kaleidoscope/LED-AlphaSquare.cpp +++ b/src/Kaleidoscope/LED-AlphaSquare.cpp @@ -24,148 +24,148 @@ static const uint16_t alphabet[] PROGMEM = { SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, - 1, 0, 0, 1), // A + 1, 0, 0, 1), // A SYM4x4(1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, - 1, 1, 1, 1), // B + 1, 1, 1, 1), // B SYM4x4(1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1), // C + 1, 1, 1, 1), // C SYM4x4(1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 1, 1, 0), // D + 1, 1, 1, 0), // D SYM4x4(1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1), // E + 1, 1, 1, 1), // E SYM4x4(1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 0, 0, 0), // F + 1, 0, 0, 0), // F SYM4x4(1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, - 1, 1, 1, 1), // G + 1, 1, 1, 1), // G SYM4x4(1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, - 1, 0, 0, 1), // H + 1, 0, 0, 1), // H SYM4x4(1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1), // I + 1, 1, 1, 1), // I SYM4x4(1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, - 0, 1, 1, 0), // J + 0, 1, 1, 0), // J SYM4x4(1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 0, 1, 1), // K + 1, 0, 1, 1), // K SYM4x4(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1), // L + 1, 1, 1, 1), // L SYM4x4(1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 0, 0, 1), // M + 1, 0, 0, 1), // M SYM4x4(1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, - 1, 0, 0, 1), // N + 1, 0, 0, 1), // N SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 1, 1, 1), // O + 1, 1, 1, 1), // O SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, - 1, 0, 0, 0), // P + 1, 0, 0, 0), // P SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, - 1, 1, 1, 1), // Q + 1, 1, 1, 1), // Q SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 0, 1, 1), // R + 1, 0, 1, 1), // R SYM4x4(1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, - 1, 1, 1, 1), // S + 1, 1, 1, 1), // S SYM4x4(1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0), // T + 0, 1, 1, 0), // T SYM4x4(1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, - 1, 1, 1, 1), // U + 1, 1, 1, 1), // U SYM4x4(1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, - 0, 1, 1, 0), // V + 0, 1, 1, 0), // V SYM4x4(1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 0, 1, 1), // W + 1, 0, 1, 1), // W SYM4x4(1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1), // X + 1, 0, 0, 1), // X SYM4x4(1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0), // Y + 0, 1, 1, 0), // Y SYM4x4(1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1), // Z + 1, 1, 1, 1), // Z // --------------------- SYM4x4(0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1), // 1 + 1, 1, 1, 1), // 1 SYM4x4(0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, - 1, 1, 0, 1), // 2 + 1, 1, 0, 1), // 2 SYM4x4(1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, - 1, 1, 1, 1), // 3 + 1, 1, 1, 1), // 3 SYM4x4(1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, - 0, 0, 0, 1), // 4 + 0, 0, 0, 1), // 4 SYM4x4(1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, - 1, 1, 1, 1), // 5 + 1, 1, 1, 1), // 5 SYM4x4(0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, - 1, 1, 1, 1), // 6 + 1, 1, 1, 1), // 6 SYM4x4(1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0), // 7 + 0, 1, 0, 0), // 7 SYM4x4(1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, - 0, 1, 1, 1), // 8 + 0, 1, 1, 1), // 8 SYM4x4(1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 1), // 9 + 0, 0, 0, 1), // 9 SYM4x4(0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, - 0, 1, 1, 0), // 0 + 0, 1, 1, 0), // 0 }; cRGB AlphaSquare::color = {0x80, 0x80, 0x80}; diff --git a/src/Kaleidoscope/LED-AlphaSquare.h b/src/Kaleidoscope/LED-AlphaSquare.h index f63ea287..32e060b4 100644 --- a/src/Kaleidoscope/LED-AlphaSquare.h +++ b/src/Kaleidoscope/LED-AlphaSquare.h @@ -25,59 +25,57 @@ p00, p01, p02, p03, \ p10, p11, p12, p13, \ p20, p21, p22, p23, \ - p30, p31, p32, p33 \ - ) \ + p30, p31, p32, p33) \ (uint16_t) ( \ p00 << 0 | p01 << 1 | p02 << 2 | p03 << 3 | \ p10 << 4 | p11 << 5 | p12 << 6 | p13 << 7 | \ p20 << 8 | p21 << 9 | p22 << 10 | p23 << 11 | \ - p30 << 12 | p31 << 13 | p32 << 14 | p33 << 15 \ - ) + p30 << 12 | p31 << 13 | p32 << 14 | p33 << 15 ) namespace KaleidoscopePlugins { class AlphaSquare : public KaleidoscopePlugin { public: AlphaSquare(void); - virtual void begin(void) final; + void begin(void) final; static void display(Key key, uint8_t row, uint8_t col, cRGB keyColor); static void display(Key key, uint8_t row, uint8_t col); static void display(Key key) { display(key, 0, 2); - }; + } static void display(Key key, uint8_t col) { display(key, 0, col); - }; + } static void display(uint16_t symbol, uint8_t row, uint8_t col, cRGB keyColor); static void display(uint16_t symbol, uint8_t row, uint8_t col); static void display(uint16_t symbol) { display(symbol, 0, 2); - }; + } static void display(uint16_t symbol, uint8_t col) { display(symbol, 0, col); - }; + } static void clear(Key key, uint8_t row, uint8_t col) { display(key, row, col, {0, 0, 0}); - }; + } static void clear(Key key, uint8_t col) { clear(key, 0, col); - }; + } static void clear(Key key) { clear(key, 0, 2); - }; + } static void clear(uint16_t symbol, uint8_t row, uint8_t col) { display(symbol, row, col, {0, 0, 0}); - }; + } static void clear(uint16_t symbol, uint8_t col) { clear(symbol, 0, col); - }; + } static void clear(uint16_t symbol) { clear(symbol, 0, 2); - }; + } static cRGB color; };