X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=keyboards%2Finfinity60%2Fmatrix.c;h=ba16e6900621551642d6265bb6f5c1b17a71c773;hb=26bbf6a66a6c1f606a64acafec3afdf9d3ad7e96;hp=62c165aa5339747179f83b5be3c74f0ab0d82291;hpb=6da0eb2b2b70d7b2c5bb1f7c6898f7d9a275ceea;p=qmk_firmware.git diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c index 62c165aa5..ba16e6900 100644 --- a/keyboards/infinity60/matrix.c +++ b/keyboards/infinity60/matrix.c @@ -60,8 +60,10 @@ void matrix_init(void) palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); #endif - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + matrix_init_quantum(); } uint8_t matrix_scan(void) @@ -96,7 +98,12 @@ uint8_t matrix_scan(void) } #endif - wait_us(1); // need wait to settle pin state + // need wait to settle pin state + // if you wait too short, or have a too high update rate + // the keyboard might freeze, or there might not be enough + // processing power to update the LCD screen properly. + // 20us, or two ticks at 100000Hz seems to be OK + wait_us(20); // read col data data = (palReadPort(GPIOD)>>1); @@ -141,6 +148,7 @@ uint8_t matrix_scan(void) } debouncing = false; } + matrix_scan_quantum(); return 1; } @@ -169,3 +177,22 @@ void matrix_print(void) xprintf("\n"); } } + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} +