From 63e179365c714b89b19f59d72ea5037744689cc1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 18 Mar 2019 17:00:02 -0700 Subject: [PATCH] astyle --- src/kaleidoscope/Hardware.h | 4 ++-- src/kaleidoscope/hardware/ATMegaKeyboard.cpp | 2 +- src/kaleidoscope/hardware/ez/ErgoDox.h | 2 +- .../hardware/keyboardio/Model01.cpp | 2 +- .../hardware/keyboardio/Model01.h | 2 +- src/kaleidoscope/plugin/HardwareTestMode.cpp | 24 +++++++++---------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/kaleidoscope/Hardware.h b/src/kaleidoscope/Hardware.h index 87a012db..0f275f0d 100644 --- a/src/kaleidoscope/Hardware.h +++ b/src/kaleidoscope/Hardware.h @@ -304,11 +304,11 @@ class Hardware { /** * Method to configure the device for a hardware test mode * - * Called by the Kaleidoscope Hardware test plugin, this method should + * Called by the Kaleidoscope Hardware test plugin, this method should * do any device-specific initialization needed for factory hardware testing * */ - void enableHardwareTestMode() {} + void enableHardwareTestMode() {} /** @} */ }; diff --git a/src/kaleidoscope/hardware/ATMegaKeyboard.cpp b/src/kaleidoscope/hardware/ATMegaKeyboard.cpp index 86060b50..b3801d2a 100644 --- a/src/kaleidoscope/hardware/ATMegaKeyboard.cpp +++ b/src/kaleidoscope/hardware/ATMegaKeyboard.cpp @@ -103,7 +103,7 @@ bool ATMegaKeyboard::wasKeyswitchPressed(uint8_t row, byte col) { bool ATMegaKeyboard::wasKeyswitchPressed(uint8_t keyIndex) { keyIndex--; return wasKeyswitchPressed(keyIndex / KeyboardHardware.matrix_columns, - keyIndex % KeyboardHardware.matrix_columns); + keyIndex % KeyboardHardware.matrix_columns); } diff --git a/src/kaleidoscope/hardware/ez/ErgoDox.h b/src/kaleidoscope/hardware/ez/ErgoDox.h index 0fdb439f..ec2da2bb 100644 --- a/src/kaleidoscope/hardware/ez/ErgoDox.h +++ b/src/kaleidoscope/hardware/ez/ErgoDox.h @@ -68,7 +68,7 @@ class ErgoDox : public kaleidoscope::Hardware { bool isKeyswitchPressed(byte row, byte col); bool isKeyswitchPressed(uint8_t keyIndex); uint8_t pressedKeyswitchCount(); - + bool wasKeyswitchPressed(byte row, byte col); bool wasKeyswitchPressed(uint8_t keyIndex); uint8_t previousPressedKeyswitchCount(); diff --git a/src/kaleidoscope/hardware/keyboardio/Model01.cpp b/src/kaleidoscope/hardware/keyboardio/Model01.cpp index 0fdfc389..55a697bc 100644 --- a/src/kaleidoscope/hardware/keyboardio/Model01.cpp +++ b/src/kaleidoscope/hardware/keyboardio/Model01.cpp @@ -85,7 +85,7 @@ void Model01::setup(void) { TWBR = 12; // This is 400mhz, which is the fastest we can drive the ATTiny } -void Model01::enableHardwareTestMode () { +void Model01::enableHardwareTestMode() { // Toggle the programming LEDS on PORTD |= (1 << 5); diff --git a/src/kaleidoscope/hardware/keyboardio/Model01.h b/src/kaleidoscope/hardware/keyboardio/Model01.h index dad7a754..60112673 100644 --- a/src/kaleidoscope/hardware/keyboardio/Model01.h +++ b/src/kaleidoscope/hardware/keyboardio/Model01.h @@ -71,7 +71,7 @@ class Model01 : public kaleidoscope::Hardware { bool isKeyswitchPressed(byte row, byte col); bool isKeyswitchPressed(uint8_t keyIndex); uint8_t pressedKeyswitchCount(); - + bool wasKeyswitchPressed(byte row, byte col); bool wasKeyswitchPressed(uint8_t keyIndex); uint8_t previousPressedKeyswitchCount(); diff --git a/src/kaleidoscope/plugin/HardwareTestMode.cpp b/src/kaleidoscope/plugin/HardwareTestMode.cpp index b4413da3..04aece10 100644 --- a/src/kaleidoscope/plugin/HardwareTestMode.cpp +++ b/src/kaleidoscope/plugin/HardwareTestMode.cpp @@ -27,14 +27,14 @@ constexpr uint8_t CHATTER_CYCLE_LIMIT = 30; uint8_t HardwareTestMode::actionKey; void HardwareTestMode::setActionKey(uint8_t key) { - actionKey = key; + actionKey = key; } void HardwareTestMode::waitForKeypress() { while (1) { KeyboardHardware.readMatrix(); - if (KeyboardHardware.isKeyswitchPressed(actionKey) && - ! KeyboardHardware.wasKeyswitchPressed(actionKey)) { + if (KeyboardHardware.isKeyswitchPressed(actionKey) && + ! KeyboardHardware.wasKeyswitchPressed(actionKey)) { break; } } @@ -68,7 +68,7 @@ void HardwareTestMode::testLeds(void) { void HardwareTestMode::testMatrix() { // Reset bad keys from previous tests. - chatter_data state[KeyboardHardware.matrix_columns * KeyboardHardware.matrix_rows] = {0,0,0}; + chatter_data state[KeyboardHardware.matrix_columns * KeyboardHardware.matrix_rows] = {0, 0, 0}; constexpr cRGB red = CRGB(201, 0, 0); constexpr cRGB blue = CRGB(0, 0, 201); @@ -81,10 +81,10 @@ void HardwareTestMode::testMatrix() { for (byte col = 0; col < KeyboardHardware.matrix_columns; col++) { uint8_t keynum = (row * KeyboardHardware.matrix_columns) + (col); - // If the key is toggled on + // If the key is toggled on if (KeyboardHardware.isKeyswitchPressed(row, col) && ! KeyboardHardware.wasKeyswitchPressed(row, col)) { // And it's too soon (in terms of cycles between changes) - state[keynum].tested = 1; + state[keynum].tested = 1; if (state[keynum].cyclesSinceStateChange < CHATTER_CYCLE_LIMIT) { state[keynum].bad = 1; } @@ -95,18 +95,18 @@ void HardwareTestMode::testMatrix() { // If the key is held down if (KeyboardHardware.isKeyswitchPressed(row, col) && KeyboardHardware.wasKeyswitchPressed(row, col)) { KeyboardHardware.setCrgbAt(row, col, green); - } + } // If we triggered chatter detection ever on this key - else if (state[keynum].bad == 1) { + else if (state[keynum].bad == 1) { KeyboardHardware.setCrgbAt(row, col, red); } else if (state[keynum].tested == 0) { - KeyboardHardware.setCrgbAt(row,col,yellow); - } + KeyboardHardware.setCrgbAt(row, col, yellow); + } // If the key is not currently pressed and was not just released and is not marked bad - else if ( ! KeyboardHardware.isKeyswitchPressed(row, col)) { + else if (! KeyboardHardware.isKeyswitchPressed(row, col)) { KeyboardHardware.setCrgbAt(row, col, blue); - } + } } } ::LEDControl.syncLeds();