X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=common%2Fmatrix.h;h=d1d14a6ead8595609accf32f608643b1194e2585;hb=ac570686b6bde1e5066ea68636ae780392739cb4;hp=c4b2cab51835b8186968187e93b8bf8907acff79;hpb=62d1ebb91c7b381ce3d88aad9ee0b03bea9fce26;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<