From 4ae979f6ef8dbf9e1d1f35be15322ad6d02e2958 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 6 Oct 2012 02:23:12 +0900 Subject: Initial version of new code for layer switch is added. --- common/matrix.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'common/matrix.h') diff --git a/common/matrix.h b/common/matrix.h index c4b2cab518..b3332d5ff9 100644 --- a/common/matrix.h +++ b/common/matrix.h @@ -18,8 +18,23 @@ along with this program. If not, see . #ifndef MATRIX_H #define MATRIX_H +#include #include + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<