Explorar o código

add col type defines

Jack Humbert %!s(int64=6) %!d(string=hai) anos
pai
achega
0284431ad9
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      tmk_core/common/matrix.h

+ 10 - 0
tmk_core/common/matrix.h

@@ -31,6 +31,16 @@ typedef  uint32_t   matrix_row_t;
 #error "MATRIX_COLS: invalid value"
 #endif
 
+#if (MATRIX_ROWS <= 8)
+typedef  uint8_t    matrix_col_t;
+#elif (MATRIX_ROWS <= 16)
+typedef  uint16_t   matrix_col_t;
+#elif (MATRIX_ROWS <= 32)
+typedef  uint32_t   matrix_col_t;
+#else
+#error "MATRIX_ROWS: invalid value"
+#endif
+
 #define MATRIX_IS_ON(row, col)  (matrix_get_row(row) && (1<<col))