aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/keyboard.c
diff options
context:
space:
mode:
authorAlex Ong <alex.ong@unsw.edu.au>2018-08-29 10:19:36 +1000
committerAlex Ong <alex.ong@unsw.edu.au>2018-08-29 10:19:36 +1000
commit3cf7f7322c24e3cab21d402f1a859b60df857603 (patch)
tree08e5f119b2faa8c393dbbad7c085fe83728046c3 /tmk_core/common/keyboard.c
parent9bd6d6112d698ea5823b268983809fe3b8d98b26 (diff)
downloadqmk_firmware-3cf7f7322c24e3cab21d402f1a859b60df857603.tar.gz
qmk_firmware-3cf7f7322c24e3cab21d402f1a859b60df857603.zip
Removed "debounce_algo = manual" in all keyboards with CUSTOM_MATRIX = yes.
Diffstat (limited to 'tmk_core/common/keyboard.c')
-rw-r--r--tmk_core/common/keyboard.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 13b3cb4c0..fe626efb3 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include <stdint.h> 18#include <stdint.h>
19#include "keyboard.h" 19#include "keyboard.h"
20#include "matrix.h" 20#include "matrix.h"
21#include "debounce.h"
21#include "keymap.h" 22#include "keymap.h"
22#include "host.h" 23#include "host.h"
23#include "led.h" 24#include "led.h"
@@ -157,6 +158,7 @@ void keyboard_init(void) {
157 MCUCR |= _BV(JTD); 158 MCUCR |= _BV(JTD);
158#endif 159#endif
159 matrix_init(); 160 matrix_init();
161 matrix_debounce_init();
160#ifdef PS2_MOUSE_ENABLE 162#ifdef PS2_MOUSE_ENABLE
161 ps2_mouse_init(); 163 ps2_mouse_init();
162#endif 164#endif
@@ -206,9 +208,6 @@ void keyboard_init(void) {
206void keyboard_task(void) 208void keyboard_task(void)
207{ 209{
208 static matrix_row_t matrix_prev[MATRIX_ROWS]; 210 static matrix_row_t matrix_prev[MATRIX_ROWS];
209#ifdef MATRIX_HAS_GHOST
210 // static matrix_row_t matrix_ghost[MATRIX_ROWS];
211#endif
212 static uint8_t led_status = 0; 211 static uint8_t led_status = 0;
213 matrix_row_t matrix_row = 0; 212 matrix_row_t matrix_row = 0;
214 matrix_row_t matrix_change = 0; 213 matrix_row_t matrix_change = 0;
@@ -217,24 +216,15 @@ void keyboard_task(void)
217#endif 216#endif
218 217
219 matrix_scan(); 218 matrix_scan();
219 matrix_debounce();
220
220 if (is_keyboard_master()) { 221 if (is_keyboard_master()) {
221 for (uint8_t r = 0; r < MATRIX_ROWS; r++) { 222 for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
222 matrix_row = matrix_get_row(r); 223 matrix_row = matrix_debounce_get_row(r);
223 matrix_change = matrix_row ^ matrix_prev[r]; 224 matrix_change = matrix_row ^ matrix_prev[r];
224 if (matrix_change) { 225 if (matrix_change) {
225#ifdef MATRIX_HAS_GHOST 226#ifdef MATRIX_HAS_GHOST
226 if (has_ghost_in_row(r, matrix_row)) { 227 if (has_ghost_in_row(r, matrix_row)) continue;
227 /* Keep track of whether ghosted status has changed for
228 * debugging. But don't update matrix_prev until un-ghosted, or
229 * the last key would be lost.
230 */
231 //if (debug_matrix && matrix_ghost[r] != matrix_row) {
232 // matrix_print();
233 //}
234 //matrix_ghost[r] = matrix_row;
235 continue;
236 }
237 //matrix_ghost[r] = matrix_row;
238#endif 228#endif
239 if (debug_matrix) matrix_print(); 229 if (debug_matrix) matrix_print();
240 for (uint8_t c = 0; c < MATRIX_COLS; c++) { 230 for (uint8_t c = 0; c < MATRIX_COLS; c++) {