X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fmatrix.h;h=d1d14a6ead8595609accf32f608643b1194e2585;hb=9e84c89535c4091522f8053a0d96b6c2ab7cc51c;hp=c4b2cab51835b8186968187e93b8bf8907acff79;hpb=62d1ebb91c7b381ce3d88aad9ee0b03bea9fce26;p=qmk_firmware.git diff --git a/common/matrix.h b/common/matrix.h index c4b2cab51..d1d14a6ea 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<