Skip to content

Commit

Permalink
add col type defines
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Jul 21, 2018
1 parent 8e86e22 commit 0284431
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tmk_core/common/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down

0 comments on commit 0284431

Please sign in to comment.