aboutsummaryrefslogtreecommitdiff
path: root/keyboard/onekey/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/onekey/matrix.c')
-rw-r--r--keyboard/onekey/matrix.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/keyboard/onekey/matrix.c b/keyboard/onekey/matrix.c
index a0a14ff82..29df86832 100644
--- a/keyboard/onekey/matrix.c
+++ b/keyboard/onekey/matrix.c
@@ -139,29 +139,29 @@ uint8_t matrix_key_count(void)
139 139
140/* Column pin configuration 140/* Column pin configuration
141 * col: 0 141 * col: 0
142 * pin: D0 142 * pin: B0
143 */ 143 */
144static void init_cols(void) 144static void init_cols(void)
145{ 145{
146 // Input with pull-up(DDR:0, PORT:1) 146 // Input with pull-up(DDR:0, PORT:1)
147 DDRD &= ~(1<<0); 147 DDRB &= ~(1<<0);
148 PORTD |= (1<<0); 148 PORTB |= (1<<0);
149} 149}
150 150
151static matrix_row_t read_cols(void) 151static matrix_row_t read_cols(void)
152{ 152{
153 return (PIND&(1<<0) ? 0 : (1<<0)); 153 return (PINB&(1<<0) ? 0 : (1<<0));
154} 154}
155 155
156/* Row pin configuration 156/* Row pin configuration
157 * row: 0 157 * row: 0
158 * pin: D1 158 * pin: B1
159 */ 159 */
160static void unselect_rows(void) 160static void unselect_rows(void)
161{ 161{
162 // Hi-Z(DDR:0, PORT:0) to unselect 162 // Hi-Z(DDR:0, PORT:0) to unselect
163 DDRD &= ~0b00000010; 163 DDRB &= ~0b00000010;
164 PORTD &= ~0b00000010; 164 PORTB &= ~0b00000010;
165} 165}
166 166
167static void select_row(uint8_t row) 167static void select_row(uint8_t row)
@@ -169,8 +169,8 @@ static void select_row(uint8_t row)
169 // Output low(DDR:1, PORT:0) to select 169 // Output low(DDR:1, PORT:0) to select
170 switch (row) { 170 switch (row) {
171 case 0: 171 case 0:
172 DDRD |= (1<<1); 172 DDRB |= (1<<1);
173 PORTD &= ~(1<<1); 173 PORTB &= ~(1<<1);
174 break; 174 break;
175 } 175 }
176} 176}