1
0

Fix key matrix issue

This commit is contained in:
Kai Ryu 2014-05-06 00:12:47 +09:00
parent ae0e33dd54
commit 7c068b03ec
2 changed files with 9 additions and 9 deletions

View File

@ -27,7 +27,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS,P7, P8, P9, PPLS, \
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,P1, P2, P3, PENT, \
LCTL,LGUI,LALT, SPC, RALT,FN0, RGUI, RCTL,P0, PDOT,PCMM ),
LCTL,LGUI,LALT, SPC, RALT,RGUI,FN0, RCTL,P0, PDOT,PCMM ),
/* Keymap 1: Fn Layer
* ,---------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | | | | | |
@ -49,7 +49,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \
TRNS,FN1, FN2, FN3, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS, FN4, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS ),
TRNS,TRNS,TRNS, FN4, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS ),
/* Keymap 2: Arrow key Overlayer
* ,---------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | | | | | |
@ -71,7 +71,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,UP, TRNS,TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,LEFT,DOWN,RGHT ),
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,LEFT,DOWN,RGHT ),
};
/*

View File

@ -138,21 +138,21 @@ uint8_t matrix_key_count(void)
/* Column pin configuration
* col: 0 1 2 3 4 5
* pin: D14 D15 A0 A1 A2 A3 (arduino)
* PB0 PB1 PF7 PF6 PF5 PF4
* pin: D17 D15 A0 A1 A2 A3 (arduino)
* PB3 PB1 PF7 PF6 PF5 PF4
*/
static void init_cols(void)
{
// Input with pull-up(DDR:0, PORT:1)
DDRF &= ~(1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
PORTF |= (1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
DDRB &= ~(1<<PB1 | 1<<PB0);
PORTB |= (1<<PB1 | 1<<PB0);
DDRB &= ~(1<<PB3 | 1<<PB1);
PORTB |= (1<<PB3 | 1<<PB1);
}
static matrix_row_t read_cols(void)
{
return (PINB&(1<<PB0) ? 0 : (1<<0)) |
return (PINB&(1<<PB3) ? 0 : (1<<0)) |
(PINB&(1<<PB1) ? 0 : (1<<1)) |
(PINF&(1<<PF7) ? 0 : (1<<2)) |
(PINF&(1<<PF6) ? 0 : (1<<3)) |
@ -173,7 +173,7 @@ static void unselect_rows(void)
DDRD |= (1<<PD3 | 1<<PD2 | 1<<PD0);
PORTD &= ~(1<<PD3 | 1<<PD2 | 1<<PD0);
DDRC |= (1<<PC6);
PORTC &= ~(1<<PC6);
PORTC |= (1<<PC6);
}
/* Row pin configuration