X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=keyboard%2Fonekey%2Fmatrix.c;h=29df868321955daf5327eef9f61855011c35d05e;hb=c7651089f2018c257f3e485d5350929a8bfa429d;hp=cd0789c60f953fd6142f7db196c1a4ee0cb3d6e8;hpb=eea3b699a6cf9976fc0179633feee6d079e5db78;p=max%2Ftmk_keyboard.git diff --git a/keyboard/onekey/matrix.c b/keyboard/onekey/matrix.c index cd0789c6..29df8683 100644 --- a/keyboard/onekey/matrix.c +++ b/keyboard/onekey/matrix.c @@ -59,6 +59,7 @@ void matrix_init(void) { debug_enable = true; debug_matrix = true; + debug_mouse = true; // initialize row and col unselect_rows(); init_cols(); @@ -138,29 +139,29 @@ uint8_t matrix_key_count(void) /* Column pin configuration * col: 0 - * pin: D0 + * pin: B0 */ static void init_cols(void) { // Input with pull-up(DDR:0, PORT:1) - DDRD &= ~(1<<0); - PORTD |= (1<<0); + DDRB &= ~(1<<0); + PORTB |= (1<<0); } static matrix_row_t read_cols(void) { - return (PIND&(1<<0) ? 0 : (1<<0)); + return (PINB&(1<<0) ? 0 : (1<<0)); } /* Row pin configuration * row: 0 - * pin: D1 + * pin: B1 */ static void unselect_rows(void) { // Hi-Z(DDR:0, PORT:0) to unselect - DDRD &= ~0b00000010; - PORTD &= ~0b00000010; + DDRB &= ~0b00000010; + PORTB &= ~0b00000010; } static void select_row(uint8_t row) @@ -168,8 +169,8 @@ static void select_row(uint8_t row) // Output low(DDR:1, PORT:0) to select switch (row) { case 0: - DDRD |= (1<<1); - PORTD &= ~(1<<1); + DDRB |= (1<<1); + PORTB &= ~(1<<1); break; } }