X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=matrix.c;h=45863e4a0a3fa7dd88b40eeaa2db6c04e544263d;hb=42d57333f3003f5be0fae62f15e186df4f03bf75;hp=6129f52c680f4f5f725d5dbbb1fe1b57a0d0f575;hpb=82309deefc21f66d92df08b8eecae8466939e04d;p=max%2Ftmk_keyboard.git diff --git a/matrix.c b/matrix.c index 6129f52c..45863e4a 100644 --- a/matrix.c +++ b/matrix.c @@ -5,7 +5,6 @@ #include #include "keymap.h" #include "matrix.h" -#include "print.h" // matrix is active low. (key on: 0/key off: 1) // row: Hi-Z(unselected)/low output(selected) @@ -115,15 +114,15 @@ static void select_row(uint8_t row) PORTF = 0x00; break; case 1: - DDRD = (1<<1); + DDRD = 0x00; PORTD = 0x00; - DDRC = 0x00; + DDRC = (1<<7); PORTC = 0x00; DDRF = 0x00; PORTF = 0x00; break; case 2: - DDRD = (1<<2); + DDRD = (1<<7); PORTD = 0x00; DDRC = 0x00; PORTC = 0x00; @@ -131,11 +130,11 @@ static void select_row(uint8_t row) PORTF = 0x00; break; case 3: - DDRD = (1<<3); + DDRD = 0x00; PORTD = 0x00; DDRC = 0x00; PORTC = 0x00; - DDRF = 0x00; + DDRF = (1<<6); PORTF = 0x00; break; case 4: @@ -147,7 +146,7 @@ static void select_row(uint8_t row) PORTF = 0x00; break; case 5: - DDRD = (1<<7); + DDRD = (1<<1); PORTD = 0x00; DDRC = 0x00; PORTC = 0x00; @@ -155,9 +154,9 @@ static void select_row(uint8_t row) PORTF = 0x00; break; case 6: - DDRD = 0x00; + DDRD = (1<<2); PORTD = 0x00; - DDRC = (1<<6); + DDRC = 0x00; PORTC = 0x00; DDRF = 0x00; PORTF = 0x00; @@ -165,7 +164,7 @@ static void select_row(uint8_t row) case 7: DDRD = 0x00; PORTD = 0x00; - DDRC = (1<<7); + DDRC = (1<<6); PORTC = 0x00; DDRF = 0x00; PORTF = 0x00;