diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/debounce/sym_defer_pk.c | 10 | ||||
-rw-r--r-- | quantum/matrix.c | 20 | ||||
-rw-r--r-- | quantum/split_common/matrix.c | 20 | ||||
-rw-r--r-- | quantum/split_common/split_util.c | 8 |
4 files changed, 19 insertions, 39 deletions
diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c index f404cf9c44..6c0e3bb071 100644 --- a/quantum/debounce/sym_defer_pk.c +++ b/quantum/debounce/sym_defer_pk.c @@ -38,12 +38,12 @@ static bool counters_need_update; #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) static uint8_t wrapping_timer_read(void) { - static uint16_t time = 0; + static uint16_t time = 0; static uint8_t last_result = 0; - uint16_t new_time = timer_read(); - uint16_t diff = new_time - time; - time = new_time; - last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); + uint16_t new_time = timer_read(); + uint16_t diff = new_time - time; + time = new_time; + last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); return last_result; } diff --git a/quantum/matrix.c b/quantum/matrix.c index cab0d2ddca..9083ff3861 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -40,9 +40,7 @@ static inline void setPinOutput_writeLow(pin_t pin) { } static inline void setPinInputHigh_atomic(pin_t pin) { - ATOMIC_BLOCK_FORCEON { - setPinInputHigh(pin); - } + ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } } // matrix code @@ -82,13 +80,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) #elif defined(DIODE_DIRECTION) # if (DIODE_DIRECTION == COL2ROW) -static void select_row(uint8_t row) { - setPinOutput_writeLow(row_pins[row]); -} +static void select_row(uint8_t row) { setPinOutput_writeLow(row_pins[row]); } -static void unselect_row(uint8_t row) { - setPinInputHigh_atomic(row_pins[row]); -} +static void unselect_row(uint8_t row) { setPinInputHigh_atomic(row_pins[row]); } static void unselect_rows(void) { for (uint8_t x = 0; x < MATRIX_ROWS; x++) { @@ -133,13 +127,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) # elif (DIODE_DIRECTION == ROW2COL) -static void select_col(uint8_t col) { - setPinOutput_writeLow(col_pins[col]); -} +static void select_col(uint8_t col) { setPinOutput_writeLow(col_pins[col]); } -static void unselect_col(uint8_t col) { - setPinInputHigh_atomic(col_pins[col]); -} +static void unselect_col(uint8_t col) { setPinInputHigh_atomic(col_pins[col]); } static void unselect_cols(void) { for (uint8_t x = 0; x < MATRIX_COLS; x++) { diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index cd5a024c3d..51bf8b1095 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -53,9 +53,7 @@ static inline void setPinOutput_writeLow(pin_t pin) { } static inline void setPinInputHigh_atomic(pin_t pin) { - ATOMIC_BLOCK_FORCEON { - setPinInputHigh(pin); - } + ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } } // matrix code @@ -95,13 +93,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) #elif defined(DIODE_DIRECTION) # if (DIODE_DIRECTION == COL2ROW) -static void select_row(uint8_t row) { - setPinOutput_writeLow(row_pins[row]); -} +static void select_row(uint8_t row) { setPinOutput_writeLow(row_pins[row]); } -static void unselect_row(uint8_t row) { - setPinInputHigh_atomic(row_pins[row]); -} +static void unselect_row(uint8_t row) { setPinInputHigh_atomic(row_pins[row]); } static void unselect_rows(void) { for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { @@ -146,13 +140,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) # elif (DIODE_DIRECTION == ROW2COL) -static void select_col(uint8_t col) { - setPinOutput_writeLow(col_pins[col]); -} +static void select_col(uint8_t col) { setPinOutput_writeLow(col_pins[col]); } -static void unselect_col(uint8_t col) { - setPinInputHigh_atomic(col_pins[col]); -} +static void unselect_col(uint8_t col) { setPinInputHigh_atomic(col_pins[col]); } static void unselect_cols(void) { for (uint8_t x = 0; x < MATRIX_COLS; x++) { diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 97d49961dc..2ae44e6e15 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -95,7 +95,7 @@ static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) { uint8_t pin_state = readPin(in_pin); // Set out_pin to a setting that is less susceptible to noise. setPinInputHigh(out_pin); - matrix_io_delay(); // Wait for the pull-up to go HIGH. + matrix_io_delay(); // Wait for the pull-up to go HIGH. return pin_state; } #endif @@ -106,11 +106,11 @@ __attribute__((weak)) bool is_keyboard_left(void) { setPinInput(SPLIT_HAND_PIN); return readPin(SPLIT_HAND_PIN); #elif defined(SPLIT_HAND_MATRIX_GRID) -# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT +# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); -# else +# else return !peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); -# endif +# endif #elif defined(EE_HANDS) return eeconfig_read_handedness(); #elif defined(MASTER_RIGHT) |