diff options
| author | Ryan <fauxpark@gmail.com> | 2020-12-18 01:06:30 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-17 14:06:30 +0000 |
| commit | 6ea4b06f9fc19825605477cdc27f5bec0f3dc0a9 (patch) | |
| tree | a5266a6ea24a9dfa1627c0273a24198c5a436b3a /quantum | |
| parent | d9dcb716bfa9eef32560a95ecb50274a0f2b170c (diff) | |
| download | qmk_firmware-6ea4b06f9fc19825605477cdc27f5bec0f3dc0a9.tar.gz qmk_firmware-6ea4b06f9fc19825605477cdc27f5bec0f3dc0a9.zip | |
Run cformat and dos2unix manually (#11235)
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 f404cf9c4..6c0e3bb07 100644 --- a/quantum/debounce/sym_defer_pk.c +++ b/quantum/debounce/sym_defer_pk.c | |||
| @@ -38,12 +38,12 @@ static bool counters_need_update; | |||
| 38 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) | 38 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) |
| 39 | 39 | ||
| 40 | static uint8_t wrapping_timer_read(void) { | 40 | static uint8_t wrapping_timer_read(void) { |
| 41 | static uint16_t time = 0; | 41 | static uint16_t time = 0; |
| 42 | static uint8_t last_result = 0; | 42 | static uint8_t last_result = 0; |
| 43 | uint16_t new_time = timer_read(); | 43 | uint16_t new_time = timer_read(); |
| 44 | uint16_t diff = new_time - time; | 44 | uint16_t diff = new_time - time; |
| 45 | time = new_time; | 45 | time = new_time; |
| 46 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); | 46 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); |
| 47 | return last_result; | 47 | return last_result; |
| 48 | } | 48 | } |
| 49 | 49 | ||
diff --git a/quantum/matrix.c b/quantum/matrix.c index cab0d2ddc..9083ff386 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
| @@ -40,9 +40,7 @@ static inline void setPinOutput_writeLow(pin_t pin) { | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | static inline void setPinInputHigh_atomic(pin_t pin) { | 42 | static inline void setPinInputHigh_atomic(pin_t pin) { |
| 43 | ATOMIC_BLOCK_FORCEON { | 43 | ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } |
| 44 | setPinInputHigh(pin); | ||
| 45 | } | ||
| 46 | } | 44 | } |
| 47 | 45 | ||
| 48 | // matrix code | 46 | // matrix code |
| @@ -82,13 +80,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | |||
| 82 | #elif defined(DIODE_DIRECTION) | 80 | #elif defined(DIODE_DIRECTION) |
| 83 | # if (DIODE_DIRECTION == COL2ROW) | 81 | # if (DIODE_DIRECTION == COL2ROW) |
| 84 | 82 | ||
| 85 | static void select_row(uint8_t row) { | 83 | static void select_row(uint8_t row) { setPinOutput_writeLow(row_pins[row]); } |
| 86 | setPinOutput_writeLow(row_pins[row]); | ||
| 87 | } | ||
| 88 | 84 | ||
| 89 | static void unselect_row(uint8_t row) { | 85 | static void unselect_row(uint8_t row) { setPinInputHigh_atomic(row_pins[row]); } |
| 90 | setPinInputHigh_atomic(row_pins[row]); | ||
| 91 | } | ||
| 92 | 86 | ||
| 93 | static void unselect_rows(void) { | 87 | static void unselect_rows(void) { |
| 94 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { | 88 | 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) | |||
| 133 | 127 | ||
| 134 | # elif (DIODE_DIRECTION == ROW2COL) | 128 | # elif (DIODE_DIRECTION == ROW2COL) |
| 135 | 129 | ||
| 136 | static void select_col(uint8_t col) { | 130 | static void select_col(uint8_t col) { setPinOutput_writeLow(col_pins[col]); } |
| 137 | setPinOutput_writeLow(col_pins[col]); | ||
| 138 | } | ||
| 139 | 131 | ||
| 140 | static void unselect_col(uint8_t col) { | 132 | static void unselect_col(uint8_t col) { setPinInputHigh_atomic(col_pins[col]); } |
| 141 | setPinInputHigh_atomic(col_pins[col]); | ||
| 142 | } | ||
| 143 | 133 | ||
| 144 | static void unselect_cols(void) { | 134 | static void unselect_cols(void) { |
| 145 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | 135 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { |
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index cd5a024c3..51bf8b109 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) { | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static inline void setPinInputHigh_atomic(pin_t pin) { | 55 | static inline void setPinInputHigh_atomic(pin_t pin) { |
| 56 | ATOMIC_BLOCK_FORCEON { | 56 | ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } |
| 57 | setPinInputHigh(pin); | ||
| 58 | } | ||
| 59 | } | 57 | } |
| 60 | 58 | ||
| 61 | // matrix code | 59 | // matrix code |
| @@ -95,13 +93,9 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | |||
| 95 | #elif defined(DIODE_DIRECTION) | 93 | #elif defined(DIODE_DIRECTION) |
| 96 | # if (DIODE_DIRECTION == COL2ROW) | 94 | # if (DIODE_DIRECTION == COL2ROW) |
| 97 | 95 | ||
| 98 | static void select_row(uint8_t row) { | 96 | static void select_row(uint8_t row) { setPinOutput_writeLow(row_pins[row]); } |
| 99 | setPinOutput_writeLow(row_pins[row]); | ||
| 100 | } | ||
| 101 | 97 | ||
| 102 | static void unselect_row(uint8_t row) { | 98 | static void unselect_row(uint8_t row) { setPinInputHigh_atomic(row_pins[row]); } |
| 103 | setPinInputHigh_atomic(row_pins[row]); | ||
| 104 | } | ||
| 105 | 99 | ||
| 106 | static void unselect_rows(void) { | 100 | static void unselect_rows(void) { |
| 107 | for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { | 101 | 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) | |||
| 146 | 140 | ||
| 147 | # elif (DIODE_DIRECTION == ROW2COL) | 141 | # elif (DIODE_DIRECTION == ROW2COL) |
| 148 | 142 | ||
| 149 | static void select_col(uint8_t col) { | 143 | static void select_col(uint8_t col) { setPinOutput_writeLow(col_pins[col]); } |
| 150 | setPinOutput_writeLow(col_pins[col]); | ||
| 151 | } | ||
| 152 | 144 | ||
| 153 | static void unselect_col(uint8_t col) { | 145 | static void unselect_col(uint8_t col) { setPinInputHigh_atomic(col_pins[col]); } |
| 154 | setPinInputHigh_atomic(col_pins[col]); | ||
| 155 | } | ||
| 156 | 146 | ||
| 157 | static void unselect_cols(void) { | 147 | static void unselect_cols(void) { |
| 158 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | 148 | 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 97d49961d..2ae44e6e1 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) { | |||
| 95 | uint8_t pin_state = readPin(in_pin); | 95 | uint8_t pin_state = readPin(in_pin); |
| 96 | // Set out_pin to a setting that is less susceptible to noise. | 96 | // Set out_pin to a setting that is less susceptible to noise. |
| 97 | setPinInputHigh(out_pin); | 97 | setPinInputHigh(out_pin); |
| 98 | matrix_io_delay(); // Wait for the pull-up to go HIGH. | 98 | matrix_io_delay(); // Wait for the pull-up to go HIGH. |
| 99 | return pin_state; | 99 | return pin_state; |
| 100 | } | 100 | } |
| 101 | #endif | 101 | #endif |
| @@ -106,11 +106,11 @@ __attribute__((weak)) bool is_keyboard_left(void) { | |||
| 106 | setPinInput(SPLIT_HAND_PIN); | 106 | setPinInput(SPLIT_HAND_PIN); |
| 107 | return readPin(SPLIT_HAND_PIN); | 107 | return readPin(SPLIT_HAND_PIN); |
| 108 | #elif defined(SPLIT_HAND_MATRIX_GRID) | 108 | #elif defined(SPLIT_HAND_MATRIX_GRID) |
| 109 | # ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT | 109 | # ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT |
| 110 | return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); | 110 | return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); |
| 111 | # else | 111 | # else |
| 112 | return !peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); | 112 | return !peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); |
| 113 | # endif | 113 | # endif |
| 114 | #elif defined(EE_HANDS) | 114 | #elif defined(EE_HANDS) |
| 115 | return eeconfig_read_handedness(); | 115 | return eeconfig_read_handedness(); |
| 116 | #elif defined(MASTER_RIGHT) | 116 | #elif defined(MASTER_RIGHT) |
