From c6eb7529cad3a52cd45182c27a69b7cf6398640c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 1 Oct 2021 19:18:08 -0700 Subject: [PATCH] Astyle --- .../device/keyboardio/Model100.cpp | 12 +++--- .../driver/keyboardio/Model100Side.cpp | 42 +++++++++---------- .../plugin/MouseKeys/MouseKeyDefs.h | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp index fd6f07cb..531082d5 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.cpp @@ -54,12 +54,12 @@ void Model100Hands::setup(void) { // TODO PORTE &= ~_BV(6); -// Turn on the switched 5V network. -// TODO - make sure this happens at least 100ms after USB connect +// Turn on the switched 5V network. +// TODO - make sure this happens at least 100ms after USB connect // to satisfy inrush limits -pinMode(PC13, OUTPUT_OPEN_DRAIN); -digitalWrite(PC13, LOW); -Wire.begin(); + pinMode(PC13, OUTPUT_OPEN_DRAIN); + digitalWrite(PC13, LOW); + Wire.begin(); // Set B4, the overcurrent check to an input with an internal pull-up // TODO DDRB &= ~_BV(4); // set bit, input // TODO PORTB &= ~_BV(4); // set bit, enable pull-up resistor @@ -109,7 +109,7 @@ cRGB Model100LEDDriver::getCrgbAt(uint8_t i) { void Model100LEDDriver::syncLeds() { if (!isLEDChanged) - return; + return; // LED Data is stored in four "banks" for each side // We send it all at once to make it look nicer. // We alternate left and right hands because otherwise diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/driver/keyboardio/Model100Side.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/driver/keyboardio/Model100Side.cpp index 1ae8a999..a5c7ff02 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/driver/keyboardio/Model100Side.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/driver/keyboardio/Model100Side.cpp @@ -67,7 +67,7 @@ uint8_t Model100Side::controllerAddress() { // https://www.arduino.cc/en/Reference/WireEndTransmission byte Model100Side::setKeyscanInterval(byte delay) { uint8_t data[] = {TWI_CMD_KEYSCAN_INTERVAL, delay}; - uint8_t result = writeData( data, ELEMENTS(data)); + uint8_t result = writeData(data, ELEMENTS(data)); return result; } @@ -103,9 +103,9 @@ byte Model100Side::setLEDSPIFrequency(byte frequency) { } -uint8_t Model100Side::writeData(uint8_t *data,uint8_t length) { +uint8_t Model100Side::writeData(uint8_t *data, uint8_t length) { Wire.beginTransmission(addr); - Wire.write( data, length); + Wire.write(data, length); uint8_t result = Wire.endTransmission(); return result; } @@ -130,30 +130,30 @@ int Model100Side::readRegister(uint8_t cmd) { Wire.requestFrom(addr, 1); // request 1 byte from the keyscanner if (Wire.available()) { - return Wire.read(); + return Wire.read(); } else { - return -1; + return -1; } - + } // gives information on the key that was just pressed or released. bool Model100Side::readKeys() { - uint8_t row_counter = 0; + uint8_t row_counter = 0; // perform blocking read into buffer uint8_t read = 0; Wire.requestFrom(addr, 5); // request 1 byte from the keyscanner if (Wire.available()) { - read = Wire.read(); - if (TWI_REPLY_KEYDATA == read) { - - while (Wire.available()) { - keyData.rows[row_counter++] = Wire.read(); - } - return true; - } + read = Wire.read(); + if (TWI_REPLY_KEYDATA == read) { + + while (Wire.available()) { + keyData.rows[row_counter++] = Wire.read(); + } + return true; + } } return false; } @@ -180,9 +180,9 @@ void Model100Side::sendLEDBank(byte bank) { * that results in a considerably smoother curve. */ uint8_t c = ledData.bytes[bank][i]; if (c > brightness_adjustment_) - c -= brightness_adjustment_; + c -= brightness_adjustment_; else - c = 0; + c = 0; data[i + 1] = c; } @@ -192,8 +192,8 @@ void Model100Side::sendLEDBank(byte bank) { void Model100Side::setAllLEDsTo(cRGB color) { uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO, color.b, - color.g, - color.r + color.g, + color.r }; uint8_t result = writeData(data, ELEMENTS(data)); } @@ -202,8 +202,8 @@ void Model100Side::setOneLEDTo(byte led, cRGB color) { uint8_t data[] = {TWI_CMD_LED_SET_ONE_TO, led, color.b, - color.g, - color.r + color.g, + color.r }; uint8_t result = writeData(data, ELEMENTS(data)); diff --git a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys/MouseKeyDefs.h b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys/MouseKeyDefs.h index 46ac2c88..6cc48de3 100644 --- a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys/MouseKeyDefs.h +++ b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys/MouseKeyDefs.h @@ -82,4 +82,4 @@ #define Key_mouseBtnN XXX -#endif +#endif