From 9da546f1742a99af2dd8c2230914109a3d618137 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 25 Jan 2016 23:47:18 -0800 Subject: [PATCH] astyle --- KeyboardConfig.cpp | 66 +++++++++++++++++++++--------------------- KeyboardConfig.h | 2 +- KeyboardioFirmware.ino | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/KeyboardConfig.cpp b/KeyboardConfig.cpp index 2bf5a637..68207380 100644 --- a/KeyboardConfig.cpp +++ b/KeyboardConfig.cpp @@ -34,55 +34,55 @@ void implementation_led_sync() { LED.sync(); } - void implementation_scan_row(byte row) { - if (left_initted) { - leftsx1509.updatePinState(left_rowpins[row], LOW); - leftsx1509.sendPinStates(); - leftsx1509.fetchPinStates(); - } - if (right_initted) { - rightsx1509.updatePinState(right_rowpins[row], LOW); - rightsx1509.sendPinStates(); - rightsx1509.fetchPinStates(); +void implementation_scan_row(byte row) { + if (left_initted) { + leftsx1509.updatePinState(left_rowpins[row], LOW); + leftsx1509.sendPinStates(); + leftsx1509.fetchPinStates(); + } + if (right_initted) { + rightsx1509.updatePinState(right_rowpins[row], LOW); + rightsx1509.sendPinStates(); + rightsx1509.fetchPinStates(); - } + } } void implementation_finish_scanning_row(byte row) { - if (left_initted) - leftsx1509.updatePinState(left_rowpins[row], HIGH); - if (right_initted) - rightsx1509.updatePinState(right_rowpins[row], HIGH); - } + if (left_initted) + leftsx1509.updatePinState(left_rowpins[row], HIGH); + if (right_initted) + rightsx1509.updatePinState(right_rowpins[row], HIGH); +} uint8_t implementation_scan_left_col(byte row, byte col,uint8_t state) { - //If we see an electrical connection on I->J, + //If we see an electrical connection on I->J, - state <<= 1; + state <<= 1; - if (left_initted && leftsx1509.readPrefetchedPin(left_colpins[col])) { - state |= 0; - } else { - state |= 1; - } - return state; + if (left_initted && leftsx1509.readPrefetchedPin(left_colpins[col])) { + state |= 0; + } else { + state |= 1; + } + return state; } uint8_t implementation_scan_right_col(byte row, byte col, uint8_t state) { - //If we see an electrical connection on I->J, + //If we see an electrical connection on I->J, - state <<= 1; + state <<= 1; - if (right_initted && rightsx1509.readPrefetchedPin(right_colpins[col])) { - state |= 0; - } else { - state |= 1; - } + if (right_initted && rightsx1509.readPrefetchedPin(right_colpins[col])) { + state |= 0; + } else { + state |= 1; + } - return state; + return state; } @@ -91,7 +91,7 @@ uint8_t implementation_scan_right_col(byte row, byte col, uint8_t state) { boolean implementation_right_hand_connected(void) { if (right_initted) { return true; - } else { + } else { return false; } } diff --git a/KeyboardConfig.h b/KeyboardConfig.h index 823c6fbe..eb21a52e 100644 --- a/KeyboardConfig.h +++ b/KeyboardConfig.h @@ -28,7 +28,7 @@ static uint8_t right_rowpins[]= {8,9,10,11}; #define KEYMAP_LIST KEYMAP_QWERTY KEYMAP_GENERIC_FN2 KEYMAP_NUMPAD void implementation_scan_row(byte row); -void implementation_finish_scanning_row(byte row); +void implementation_finish_scanning_row(byte row); uint8_t implementation_scan_right_col(byte row, byte col, uint8_t state); uint8_t implementation_scan_left_col(byte row, byte col, uint8_t state); void implementation_pins_setup(); diff --git a/KeyboardioFirmware.ino b/KeyboardioFirmware.ino index d584ea23..5669be16 100644 --- a/KeyboardioFirmware.ino +++ b/KeyboardioFirmware.ino @@ -78,7 +78,7 @@ void scan_matrix() { TS("calling send_key_event") send_key_event(row, col); - + if (implementation_right_hand_connected()) { send_key_event(row, (COLS - 1) - col); }