diff options
author | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
commit | e7f4d56592b3975c38af329e77b4efd9108495e8 (patch) | |
tree | 0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /tmk_core/common/matrix.h | |
parent | 71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff) | |
parent | 8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff) | |
download | qmk_firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tmk_core/common/matrix.h')
-rw-r--r-- | tmk_core/common/matrix.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index e5665bf40..7624d5137 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -20,29 +20,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h> #include <stdbool.h> - #if (MATRIX_COLS <= 8) -typedef uint8_t matrix_row_t; +typedef uint8_t matrix_row_t; #elif (MATRIX_COLS <= 16) -typedef uint16_t matrix_row_t; +typedef uint16_t matrix_row_t; #elif (MATRIX_COLS <= 32) -typedef uint32_t matrix_row_t; +typedef uint32_t matrix_row_t; #else -#error "MATRIX_COLS: invalid value" +# error "MATRIX_COLS: invalid value" #endif #if (MATRIX_ROWS <= 8) -typedef uint8_t matrix_col_t; +typedef uint8_t matrix_col_t; #elif (MATRIX_ROWS <= 16) -typedef uint16_t matrix_col_t; +typedef uint16_t matrix_col_t; #elif (MATRIX_ROWS <= 32) -typedef uint32_t matrix_col_t; +typedef uint32_t matrix_col_t; #else -#error "MATRIX_ROWS: invalid value" +# error "MATRIX_ROWS: invalid value" #endif -#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<<col)) - +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1 << col)) #ifdef __cplusplus extern "C" { @@ -59,7 +57,7 @@ void matrix_init(void); /* scan all key states on matrix */ uint8_t matrix_scan(void); /* whether modified from previous scan. used after matrix_scan. */ -bool matrix_is_modified(void) __attribute__ ((deprecated)); +bool matrix_is_modified(void) __attribute__((deprecated)); /* whether a switch is on */ bool matrix_is_on(uint8_t row, uint8_t col); /* matrix state on row */ @@ -67,7 +65,6 @@ matrix_row_t matrix_get_row(uint8_t row); /* print matrix for debug */ void matrix_print(void); - /* power control */ void matrix_power_up(void); void matrix_power_down(void); @@ -83,8 +80,8 @@ void matrix_init_user(void); void matrix_scan_user(void); #ifdef I2C_SPLIT - void slave_matrix_init(void); - uint8_t slave_matrix_scan(void); +void slave_matrix_init(void); +uint8_t slave_matrix_scan(void); #endif #ifdef __cplusplus |