Pārlūkot izejas kodu

Debounce bug fixed

tags/v1.9
Jeffrey Sung pirms 11 gadiem
vecāks
revīzija
caed32df80
2 mainītis faili ar 12 papildinājumiem un 7 dzēšanām
  1. 1
    1
      keyboard/IIgs_Standard/config.h
  2. 11
    6
      keyboard/IIgs_Standard/matrix.c

+ 1
- 1
keyboard/IIgs_Standard/config.h Parādīt failu

/* define if matrix has ghost */ /* define if matrix has ghost */
#define MATRIX_HAS_GHOST #define MATRIX_HAS_GHOST
/* Set 0 if need no debouncing */ /* Set 0 if need no debouncing */
#define DEBOUNCE 0
#define DEBOUNCE 5
/* key combination for command */ /* key combination for command */

+ 11
- 6
keyboard/IIgs_Standard/matrix.c Parādīt failu

matrix[i] = ~read_col(i) | 0b00010000; // send fake caps lock down matrix[i] = ~read_col(i) | 0b00010000; // send fake caps lock down
} }
} else { // CAPS LOCK is OFF on HOST } else { // CAPS LOCK is OFF on HOST
matrix[i] = ~read_col(i);
if (matrix[i] != (uint8_t)~read_col(i)) {
matrix[i] = (uint8_t)~read_col(i);
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); print("\n");
}
debouncing = DEBOUNCE;
}
} }
} else { } else {
if (matrix[i] != (uint8_t)~read_col(i)) { if (matrix[i] != (uint8_t)~read_col(i)) {
matrix[i] = (uint8_t)~read_col(i); matrix[i] = (uint8_t)~read_col(i);
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); print("\n");
}
debouncing = DEBOUNCE;
} }
} }
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); print("\n");
}
debouncing = DEBOUNCE;
} }
unselect_rows(); unselect_rows();


tmp |= (PINF >> 1 ) & 0b00001000; // LEFT GUI is 3bit in modifier (HID Spec) tmp |= (PINF >> 1 ) & 0b00001000; // LEFT GUI is 3bit in modifier (HID Spec)
tmp |= (PINA << 4 ) & 0b00010000; // CAPSLOCK tmp |= (PINA << 4 ) & 0b00010000; // CAPSLOCK
tmp |= (PINB << 3 ) & 0b00100000; // POWER tmp |= (PINB << 3 ) & 0b00100000; // POWER
//tmp |= (PINE << 1 ) & 0b00010000; // Caps Lock(Should not be in modifier
} else { } else {
tmp = 0x00; tmp = 0x00;
tmp = (PINE >> 1)&0b00000001; tmp = (PINE >> 1)&0b00000001;

Notiek ielāde…
Atcelt
Saglabāt