From b7415039cb4694dfd2bba005366424a3e2d9bbcd Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 6 Aug 2017 15:28:40 +0200 Subject: [PATCH] make astyle Signed-off-by: Gergely Nagy --- examples/Steno/Steno.ino | 26 +++---- src/Kaleidoscope/GeminiPR.cpp | 44 ++++++------ src/Kaleidoscope/GeminiPR.h | 124 +++++++++++++++++----------------- 3 files changed, 97 insertions(+), 97 deletions(-) diff --git a/examples/Steno/Steno.ino b/examples/Steno/Steno.ino index 32f5701b..80246b50 100644 --- a/examples/Steno/Steno.ino +++ b/examples/Steno/Steno.ino @@ -32,28 +32,28 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { 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_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_Keymap1), [1] = KEYMAP_STACKED - ( XXX ,XXX ,XXX ,XXX ,XXX ,XXX ,S(N6) - ,XXX ,S(N1) ,S(N2) ,S(N3) ,S(N4) ,S(N5) ,S(ST1) - ,S(FN) ,S(S1) ,S(TL) ,S(PL) ,S(HL) ,S(ST1) - ,S(PWR) ,S(S2) ,S(KL) ,S(WL) ,S(RL) ,S(ST2) ,S(ST2) + (XXX, XXX, XXX, XXX, XXX, XXX, S(N6), + XXX, S(N1), S(N2), S(N3), S(N4), S(N5), S(ST1), + S(FN), S(S1), S(TL), S(PL), S(HL), S(ST1), + S(PWR), S(S2), S(KL), S(WL), S(RL), S(ST2), S(ST2), - ,S(RE1) ,XXX ,S(A) ,S(O) - ,___ + S(RE1), XXX, S(A), S(O), + ___, - ,S(N7) ,XXX ,XXX ,XXX ,XXX ,XXX ,XXX - ,S(ST3) ,S(N8) ,S(N9) ,S(NA) ,S(NB) ,S(NC) ,XXX - ,S(ST3) ,S(FR) ,S(PR) ,S(LR) ,S(TR) ,S(DR) - ,S(ST4) ,S(ST4) ,S(RR) ,S(BR) ,S(GR) ,S(SR) ,S(ZR) + S(N7), XXX, XXX, XXX, XXX, XXX, XXX, + S(ST3), S(N8), S(N9), S(NA), S(NB), S(NC), XXX, + S(ST3), S(FR), S(PR), S(LR), S(TR), S(DR), + S(ST4), S(ST4), S(RR), S(BR), S(GR), S(SR), S(ZR), - ,S(E) ,S(U) ,XXX ,S(RE2) - ,___), + S(E), S(U), XXX, S(RE2), + ___), }; void setup() { diff --git a/src/Kaleidoscope/GeminiPR.cpp b/src/Kaleidoscope/GeminiPR.cpp index 755e8019..05d18f9c 100644 --- a/src/Kaleidoscope/GeminiPR.cpp +++ b/src/Kaleidoscope/GeminiPR.cpp @@ -21,35 +21,35 @@ namespace kaleidoscope { namespace steno { - uint8_t GeminiPR::keys_held_; - uint8_t GeminiPR::state_[6]; +uint8_t GeminiPR::keys_held_; +uint8_t GeminiPR::state_[6]; - void GeminiPR::begin(void) { - Kaleidoscope.useEventHandlerHook(eventHandlerHook); - } +void GeminiPR::begin(void) { + Kaleidoscope.useEventHandlerHook(eventHandlerHook); +} - Key GeminiPR::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) { - if (mapped_key < geminipr::START || - mapped_key > geminipr::END) - return mapped_key; +Key GeminiPR::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) { + if (mapped_key < geminipr::START || + mapped_key > geminipr::END) + return mapped_key; - if (keyToggledOn(key_state)) { - uint8_t key = mapped_key.raw - geminipr::START; - ++keys_held_; + if (keyToggledOn(key_state)) { + uint8_t key = mapped_key.raw - geminipr::START; + ++keys_held_; - state_[key / 7] |= 1 << (6 - (key % 7)); - } else if (keyToggledOff(key_state)) { - --keys_held_; + state_[key / 7] |= 1 << (6 - (key % 7)); + } else if (keyToggledOff(key_state)) { + --keys_held_; - if (keys_held_ == 0) { - state_[0] |= 0x80; - Serial.write(state_, sizeof(state_)); - memset(state_, 0, sizeof(state_)); - } + if (keys_held_ == 0) { + state_[0] |= 0x80; + Serial.write(state_, sizeof(state_)); + memset(state_, 0, sizeof(state_)); } - - return Key_NoKey; } + + return Key_NoKey; +} } } diff --git a/src/Kaleidoscope/GeminiPR.h b/src/Kaleidoscope/GeminiPR.h index 39a9ca18..b868903f 100644 --- a/src/Kaleidoscope/GeminiPR.h +++ b/src/Kaleidoscope/GeminiPR.h @@ -25,72 +25,72 @@ namespace kaleidoscope { namespace steno { - class GeminiPR : public KaleidoscopePlugin { - public: - GeminiPR(void) {}; +class GeminiPR : public KaleidoscopePlugin { + public: + GeminiPR(void) {}; - void begin(void); + void begin(void); - private: - static uint8_t keys_held_; - static uint8_t state_[6]; + private: + static uint8_t keys_held_; + static uint8_t state_[6]; - static Key eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state); - }; + static Key eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state); +}; - namespace geminipr { - enum { - START = kaleidoscope::ranges::STENO_START, - FN = START, - NUM, - N1 = NUM, - N2, - N3, - N4, - N5, - N6, - SL, - S1 = SL, - S2, - TL, - KL, - PL, - WL, - HL, - RL, - A, - O, - STR, - ST1 = STR, - ST2, - RES1, - RE1 = RES1, - RES2, - RE2 = RES2, - PWR, - ST3, - ST4, - E, - U, - FR, - RR, - PR, - BR, - LR, - GR, - TR, - SR, - DR, - N7, - N8, - N9, - NA, - NB, - NC, - ZR, - END = ZR, - }; - } +namespace geminipr { +enum { + START = kaleidoscope::ranges::STENO_START, + FN = START, + NUM, + N1 = NUM, + N2, + N3, + N4, + N5, + N6, + SL, + S1 = SL, + S2, + TL, + KL, + PL, + WL, + HL, + RL, + A, + O, + STR, + ST1 = STR, + ST2, + RES1, + RE1 = RES1, + RES2, + RE2 = RES2, + PWR, + ST3, + ST4, + E, + U, + FR, + RR, + PR, + BR, + LR, + GR, + TR, + SR, + DR, + N7, + N8, + N9, + NA, + NB, + NC, + ZR, + END = ZR, +}; +} } }