X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=common%2Fmatrix.h;h=d1d14a6ead8595609accf32f608643b1194e2585;hb=3eeb0a96232af825962fa1e9b05b80ac1cfd1868;hp=c4b2cab51835b8186968187e93b8bf8907acff79;hpb=f4125707399d11a7d80587659c464b9bcddb8c56;p=max%2Ftmk_keyboard.git diff --git a/common/matrix.h b/common/matrix.h index c4b2cab5..d1d14a6e 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<