diff options
Diffstat (limited to 'keyboards/jj50/matrix.c')
| -rw-r--r-- | keyboards/jj50/matrix.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/keyboards/jj50/matrix.c b/keyboards/jj50/matrix.c index 8f9c67fe4..95c6057e7 100644 --- a/keyboards/jj50/matrix.c +++ b/keyboards/jj50/matrix.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | 2 | Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> |
| 3 | Modified 2018 by Wayne K Jones <github.com/WarmCatUK> | ||
| 3 | 4 | ||
| 4 | This program is free software: you can redistribute it and/or modify | 5 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
| @@ -36,17 +37,20 @@ void matrix_init(void) { | |||
| 36 | // all inputs for columns | 37 | // all inputs for columns |
| 37 | DDRA = 0x00; | 38 | DDRA = 0x00; |
| 38 | DDRC &= ~(0x111111<<2); | 39 | DDRC &= ~(0x111111<<2); |
| 39 | DDRD &= ~(1<<PIND7); | 40 | //----> DDRD &= ~(1<<PIND7); |
| 41 | // Port D not used on this keyboard | ||
| 40 | // all columns are pulled-up | 42 | // all columns are pulled-up |
| 41 | PORTA = 0xFF; | 43 | PORTA = 0xFF; |
| 42 | PORTC |= (0b111111<<2); | 44 | PORTC |= (0b111111<<2); |
| 43 | //PORTD |= (1<<PIND7); | 45 | //PORTD |= (1<<PIND7); |
| 46 | // Port D not used on this keyboard | ||
| 44 | 47 | ||
| 45 | // initialize matrix state: all keys off | 48 | // initialize matrix state: all keys off |
| 46 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | 49 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { |
| 47 | matrix[row] = 0x00; | 50 | matrix[row] = 0x00; |
| 48 | matrix_debouncing[row] = 0x00; | 51 | matrix_debouncing[row] = 0x00; |
| 49 | } | 52 | } |
| 53 | matrix_init_quantum(); // missing from original port by Luiz | ||
| 50 | } | 54 | } |
| 51 | 55 | ||
| 52 | void matrix_set_row_status(uint8_t row) { | 56 | void matrix_set_row_status(uint8_t row) { |
| @@ -72,9 +76,6 @@ uint8_t matrix_scan(void) { | |||
| 72 | ) | ( | 76 | ) | ( |
| 73 | // cols 8..13, PORTC 7 -> 0 | 77 | // cols 8..13, PORTC 7 -> 0 |
| 74 | bit_reverse((~PINC) & 0xFF) << 8 | 78 | bit_reverse((~PINC) & 0xFF) << 8 |
| 75 | ) | ( | ||
| 76 | // col 14, PORTD 7 | ||
| 77 | ((~PIND) & (1 << PIND7)) << 7 | ||
| 78 | ); | 79 | ); |
| 79 | 80 | ||
| 80 | if (matrix_debouncing[row] != cols) { | 81 | if (matrix_debouncing[row] != cols) { |
| @@ -92,8 +93,8 @@ uint8_t matrix_scan(void) { | |||
| 92 | } | 93 | } |
| 93 | } | 94 | } |
| 94 | } | 95 | } |
| 95 | 96 | matrix_scan_quantum(); // also missing in original PS2AVRGB implementation | |
| 96 | matrix_scan_user(); | 97 | //matrix_scan_user(); |
| 97 | 98 | ||
| 98 | return 1; | 99 | return 1; |
| 99 | } | 100 | } |
