From fef5deea4a9e219b4f0437b002927c2042e414aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sat, 29 Apr 2017 21:15:04 +0200 Subject: [PATCH] Handle disable key matrix scan test action for the right keyboard half. --- right/src/usb_report_updater.c | 8 ++++++-- shared/key_matrix.c | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index d3ac037..32ab7d7 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -72,9 +72,13 @@ void processMouseAction(key_action_t action) } void processTestAction(key_action_t testAction) { - if (testAction.test.testAction == TestAction_DisableI2c) { + switch (testAction.test.testAction) { + case TestAction_DisableI2c: TestStates.disableI2c = true; - TEST_LED_OFF(); + break; + case TestAction_DisableKeyMatrixScan: + TestStates.disableKeyMatrixScan = true; + break; } } diff --git a/shared/key_matrix.c b/shared/key_matrix.c index 75c0b67..1fe29a3 100644 --- a/shared/key_matrix.c +++ b/shared/key_matrix.c @@ -1,5 +1,6 @@ #include "fsl_gpio.h" #include "key_matrix.h" +#include "test_states.h" void KeyMatrix_Init(key_matrix_t *keyMatrix) { @@ -20,6 +21,10 @@ void KeyMatrix_Init(key_matrix_t *keyMatrix) void KeyMatrix_Scan(key_matrix_t *keyMatrix) { + if (TestStates.disableKeyMatrixScan) { + return; + } + uint8_t *keyState = keyMatrix->keyStates; key_matrix_pin_t *rowEnd = keyMatrix->rows + keyMatrix->rowNum;