X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=inline;f=common%2Fmatrix.h;h=b3332d5ff91ca3132cc5524a4b6485df568d5b0c;hb=81141ad0eba1a9db9abd0f7903d8077c28e76b40;hp=c4b2cab51835b8186968187e93b8bf8907acff79;hpb=62d1ebb91c7b381ce3d88aad9ee0b03bea9fce26;p=max%2Ftmk_keyboard.git
diff --git a/common/matrix.h b/common/matrix.h
index c4b2cab5..b3332d5f 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<