summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
authorEric Tang <e_l_tang@outlook.com>2016-05-24 08:44:40 -0700
committerJack Humbert <jack.humb@gmail.com>2016-05-24 11:44:40 -0400
commit1ae6011cef2230826a9e6db6c5b638677bc640b7 (patch)
treed101c5495b8d9c0dde776d9f7d90f7aa7038483a /tmk_core/common
parent897f5b2f9d430b780149b46ba113a3fc61483b54 (diff)
downloadqmk_firmware-1ae6011cef2230826a9e6db6c5b638677bc640b7.tar.gz
qmk_firmware-1ae6011cef2230826a9e6db6c5b638677bc640b7.zip
Clean up #343's code (#348)
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/keyboard.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index c6d54ae333..bd543c45e1 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -96,17 +96,15 @@ void keyboard_init(void) {
/* does routine keyboard jobs */
void keyboard_task(void) {
- static matrix_row_t previous_matrix[MATRIX_ROWS];
-#ifdef MATRIX_HAS_GHOST
- static matrix_row_t deghosting_matrix[MATRIX_ROWS];
-#endif
- static uint8_t led_status = 0;
+ static uint8_t led_status;
matrix_scan();
for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
+ static matrix_row_t previous_matrix[MATRIX_ROWS];
matrix_row_t state = matrix_get_row(r);
matrix_row_t changes = state ^ previous_matrix[r];
if (changes) {
#ifdef MATRIX_HAS_GHOST
+ static matrix_row_t deghosting_matrix[MATRIX_ROWS];
if (is_row_ghosting(r)) {
/* debugs the deghosting mechanism */
/* doesn't update previous_matrix until the ghosting has stopped