X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=tmk_core%2Fcommon%2Fmatrix.h;h=e5665bf40a3f52baabfdd8a36d0ef89baf75fa01;hb=79d495f51dd0d49a4e0ba84f3bcec588dba498b5;hp=5f2f831b4539280eeac60c598a168a6d4ce5ce3a;hpb=d2fc24d2a05f8f1e8f8a5b7e391db1418c87a038;p=qmk_firmware.git diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 5f2f831b4..e5665bf40 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -20,59 +20,58 @@ along with this program. If not, see . #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; + +#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 "There are too many columns." +#error "MATRIX_COLS: invalid value" #endif -#if DIODE_DIRECTION == ROW2COL -# 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 "There are too many rows." -# 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 -typedef struct { - uint8_t input_addr:4; - uint8_t bit:4; -} io_pin_t; +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<