Skip to content

Commit

Permalink
Use interrupt based keyboard matrix scanning for the right keyboard h…
Browse files Browse the repository at this point in the history
…alf. Get rid of INTERRUPT_KEY_SCANNER
  • Loading branch information
mondalaci committed Nov 13, 2017
1 parent 332f2a6 commit ae4d608
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion right/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// Macros:

#define I2C_WATCHDOG
// #define INTERRUPT_KEY_SCANNER
// #define LED_DRIVER_STRESS_TEST

#endif
11 changes: 4 additions & 7 deletions right/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -43,6 +39,9 @@ void updateUsbReports(void)
SwitchActiveUsbMouseReport();

IsUsbBasicKeyboardReportSent = false;
IsUsbMediaKeyboardReportSent = false;
IsUsbSystemKeyboardReportSent = false;
IsUsbMouseReportSent = false;
}

bool IsEepromInitialized = false;
Expand Down Expand Up @@ -74,9 +73,7 @@ void main(void)
} else {
InitSlaveScheduler();
KeyMatrix_Init(&RightKeyMatrix);
#ifdef INTERRUPT_KEY_SCANNER
InitKeyScanner();
#endif
updateUsbReports();
InitUsb();

Expand Down
2 changes: 1 addition & 1 deletion right/src/timer.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "fsl_pit.h"
#include "timer.h"

uint32_t CurrentTime = 1;
uint32_t CurrentTime;

void PIT_TIMER_HANDLER(void)
{
Expand Down

0 comments on commit ae4d608

Please sign in to comment.