aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/matrix.h
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2018-07-19 23:56:47 -0400
committerJack Humbert <jack.humb@gmail.com>2018-07-20 23:09:25 -0400
commit0284431ad935b05fad212fb3925e8104007ab93f (patch)
treec4549bf3d1a6b0d8db8a2bc2f52d9aab4123232a /tmk_core/common/matrix.h
parent8e86e2218786c1830611cf9a4780a87eb8befeb1 (diff)
downloadqmk_firmware-0284431ad935b05fad212fb3925e8104007ab93f.tar.gz
qmk_firmware-0284431ad935b05fad212fb3925e8104007ab93f.zip
add col type defines
Diffstat (limited to 'tmk_core/common/matrix.h')
-rw-r--r--tmk_core/common/matrix.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h
index 2543f5abc..e5665bf40 100644
--- a/tmk_core/common/matrix.h
+++ b/tmk_core/common/matrix.h
@@ -31,6 +31,16 @@ typedef uint32_t matrix_row_t;
31#error "MATRIX_COLS: invalid value" 31#error "MATRIX_COLS: invalid value"
32#endif 32#endif
33 33
34#if (MATRIX_ROWS <= 8)
35typedef uint8_t matrix_col_t;
36#elif (MATRIX_ROWS <= 16)
37typedef uint16_t matrix_col_t;
38#elif (MATRIX_ROWS <= 32)
39typedef uint32_t matrix_col_t;
40#else
41#error "MATRIX_ROWS: invalid value"
42#endif
43
34#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<<col)) 44#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<<col))
35 45
36 46