summaryrefslogtreecommitdiff
path: root/keyboard/IIgs_Standard/matrix.c
diff options
context:
space:
mode:
authorJeffrey Sung <nattyman@gmail.com>2012-10-09 00:28:33 +0900
committerJeffrey Sung <nattyman@gmail.com>2012-10-09 00:28:33 +0900
commitcaed32df808b2ac46b5fd9fcc918fb87762e3c3d (patch)
tree2d5e6e13e5d6103618dcfd48bdac79ab84dcfde0 /keyboard/IIgs_Standard/matrix.c
parentd1117dca320c09d4cbb34a9ad6c24550d37ae81f (diff)
downloadqmk_firmware-caed32df808b2ac46b5fd9fcc918fb87762e3c3d.tar.gz
qmk_firmware-caed32df808b2ac46b5fd9fcc918fb87762e3c3d.zip
Debounce bug fixed
Diffstat (limited to 'keyboard/IIgs_Standard/matrix.c')
-rw-r--r--keyboard/IIgs_Standard/matrix.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/keyboard/IIgs_Standard/matrix.c b/keyboard/IIgs_Standard/matrix.c
index 6cd806e2d8..6ca55b7ea2 100644
--- a/keyboard/IIgs_Standard/matrix.c
+++ b/keyboard/IIgs_Standard/matrix.c
@@ -130,17 +130,23 @@ uint8_t matrix_scan(void)
matrix[i] = ~read_col(i) | 0b00010000; // send fake caps lock down
}
} 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 {
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;
}
}
- if (debouncing) {
- debug("bounce!: "); debug_hex(debouncing); print("\n");
- }
- debouncing = DEBOUNCE;
}
unselect_rows();
@@ -264,7 +270,6 @@ static uint8_t read_col(uint8_t row)
tmp |= (PINF >> 1 ) & 0b00001000; // LEFT GUI is 3bit in modifier (HID Spec)
tmp |= (PINA << 4 ) & 0b00010000; // CAPSLOCK
tmp |= (PINB << 3 ) & 0b00100000; // POWER
- //tmp |= (PINE << 1 ) & 0b00010000; // Caps Lock(Should not be in modifier
} else {
tmp = 0x00;
tmp = (PINE >> 1)&0b00000001;