Implement disabling keyboard matrix scanning for the left keyboard half, too.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "i2c.h"
|
||||
#include "led_pwm.h"
|
||||
#include "bridge_protocol.h"
|
||||
#include "main.h"
|
||||
|
||||
void SetError(uint8_t error);
|
||||
void SetGenericError();
|
||||
@@ -43,5 +44,9 @@ void BridgeProtocolHandler()
|
||||
uint8_t brightnessPercent = BridgeRxBuffer[1];
|
||||
LedPwm_SetBrightness(brightnessPercent);
|
||||
break;
|
||||
case BridgeCommand_SetDisableKeyMatrixScanState:
|
||||
BridgeTxSize = 0;
|
||||
DisableKeyMatrixScanState = BridgeRxBuffer[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ key_matrix_t keyMatrix = {
|
||||
#endif
|
||||
};
|
||||
|
||||
volatile bool DisableKeyMatrixScanState;
|
||||
|
||||
typedef struct BootloaderConfiguration
|
||||
{
|
||||
uint32_t tag; // Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'.
|
||||
@@ -86,7 +88,9 @@ int main(void)
|
||||
KeyMatrix_Init(&keyMatrix);
|
||||
|
||||
while (1) {
|
||||
KeyMatrix_Scan(&keyMatrix);
|
||||
if (!DisableKeyMatrixScanState) {
|
||||
KeyMatrix_Scan(&keyMatrix);
|
||||
}
|
||||
asm("wfi");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
// Variables:
|
||||
|
||||
extern key_matrix_t keyMatrix;
|
||||
extern volatile bool DisableKeyMatrixScanState;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user