X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fmatrix.h;h=d1d14a6ead8595609accf32f608643b1194e2585;hb=b9e265368fde73daff069788dcb58c8230d01b32;hp=c4b2cab51835b8186968187e93b8bf8907acff79;hpb=f4125707399d11a7d80587659c464b9bcddb8c56;p=tmk_firmware.git
diff --git a/common/matrix.h b/common/matrix.h
index c4b2cab..d1d14a6 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<