diff options
author | fauxpark <fauxpark@gmail.com> | 2020-01-19 14:11:57 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-19 14:11:57 +1100 |
commit | eb5d267e637db4c2c639932b8c8176bf47dff78f (patch) | |
tree | 8e9f36d80dac91f40b95eb53022118bb7deb94a3 /quantum/matrix.c | |
parent | eaed517c0bfb10c9169457ba2a187c0c4b0eef2e (diff) | |
download | qmk_firmware-eb5d267e637db4c2c639932b8c8176bf47dff78f.tar.gz qmk_firmware-eb5d267e637db4c2c639932b8c8176bf47dff78f.zip |
Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards (#7915)
* Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards
* Define diode direction for failing boards
* Matching parentheses
* Put onekey diode directions in top level config
Diffstat (limited to 'quantum/matrix.c')
-rw-r--r-- | quantum/matrix.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c index 1675f2477..6bd604bb7 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
@@ -62,7 +62,8 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | |||
62 | return (last_row_value != current_matrix[current_row]); | 62 | return (last_row_value != current_matrix[current_row]); |
63 | } | 63 | } |
64 | 64 | ||
65 | #elif (DIODE_DIRECTION == COL2ROW) | 65 | #elif defined(DIODE_DIRECTION) |
66 | # if (DIODE_DIRECTION == COL2ROW) | ||
66 | 67 | ||
67 | static void select_row(uint8_t row) { | 68 | static void select_row(uint8_t row) { |
68 | setPinOutput(row_pins[row]); | 69 | setPinOutput(row_pins[row]); |
@@ -110,7 +111,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | |||
110 | return (last_row_value != current_matrix[current_row]); | 111 | return (last_row_value != current_matrix[current_row]); |
111 | } | 112 | } |
112 | 113 | ||
113 | #elif (DIODE_DIRECTION == ROW2COL) | 114 | # elif (DIODE_DIRECTION == ROW2COL) |
114 | 115 | ||
115 | static void select_col(uint8_t col) { | 116 | static void select_col(uint8_t col) { |
116 | setPinOutput(col_pins[col]); | 117 | setPinOutput(col_pins[col]); |
@@ -165,6 +166,11 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) | |||
165 | return matrix_changed; | 166 | return matrix_changed; |
166 | } | 167 | } |
167 | 168 | ||
169 | # else | ||
170 | # error DIODE_DIRECTION must be one of COL2ROW or ROW2COL! | ||
171 | # endif | ||
172 | #else | ||
173 | # error DIODE_DIRECTION is not defined! | ||
168 | #endif | 174 | #endif |
169 | 175 | ||
170 | void matrix_init(void) { | 176 | void matrix_init(void) { |