From ae4d60882fc10560266b2712f15ddf7c38f93bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 13 Nov 2017 02:18:55 +0100 Subject: [PATCH] Use interrupt based keyboard matrix scanning for the right keyboard half. Get rid of INTERRUPT_KEY_SCANNER --- right/src/config.h | 1 - right/src/main.c | 11 ++++------- right/src/timer.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/right/src/config.h b/right/src/config.h index 75e32d6..f5d3291 100644 --- a/right/src/config.h +++ b/right/src/config.h @@ -4,7 +4,6 @@ // Macros: #define I2C_WATCHDOG -// #define INTERRUPT_KEY_SCANNER // #define LED_DRIVER_STRESS_TEST #endif diff --git a/right/src/main.c b/right/src/main.c index 8181666..2861a44 100644 --- a/right/src/main.c +++ b/right/src/main.c @@ -22,14 +22,10 @@ void updateUsbReports(void) { - if (!IsUsbBasicKeyboardReportSent) { + if (!IsUsbBasicKeyboardReportSent || !IsUsbMediaKeyboardReportSent || /*!IsUsbSystemKeyboardReportSent ||*/ !IsUsbMouseReportSent) { return; } -#ifndef INTERRUPT_KEY_SCANNER - KeyMatrix_Scan(&RightKeyMatrix); -#endif - ResetActiveUsbBasicKeyboardReport(); ResetActiveUsbMediaKeyboardReport(); ResetActiveUsbSystemKeyboardReport(); @@ -43,6 +39,9 @@ void updateUsbReports(void) SwitchActiveUsbMouseReport(); IsUsbBasicKeyboardReportSent = false; + IsUsbMediaKeyboardReportSent = false; + IsUsbSystemKeyboardReportSent = false; + IsUsbMouseReportSent = false; } bool IsEepromInitialized = false; @@ -74,9 +73,7 @@ void main(void) } else { InitSlaveScheduler(); KeyMatrix_Init(&RightKeyMatrix); -#ifdef INTERRUPT_KEY_SCANNER InitKeyScanner(); -#endif updateUsbReports(); InitUsb(); diff --git a/right/src/timer.c b/right/src/timer.c index 149b471..65a9672 100644 --- a/right/src/timer.c +++ b/right/src/timer.c @@ -1,7 +1,7 @@ #include "fsl_pit.h" #include "timer.h" -uint32_t CurrentTime = 1; +uint32_t CurrentTime; void PIT_TIMER_HANDLER(void) {