Add command to enable/disable key output. (#29)

This function is needed for preventing the device from submitting serial
commands by itself during calibration.
This commit is contained in:
Tatsuhisa Yamaguchi
2024-10-03 19:09:09 +09:00
committed by Takashi Toyoshima
parent 3561e299ce
commit 6f8ee87e94
2 changed files with 8 additions and 10 deletions

View File

@@ -77,16 +77,12 @@ void LoadDefaultConfig() {
void setup() {
Serial.begin(115200);
Keyboard.begin();
LoadConfig();
pinMode(kLedPin, OUTPUT);
digitalWrite(kLedPin, LOW);
}
void SetupKeyboard() {
enable_key_output = true;
Keyboard.begin();
}
void OutputKey(const char* str) {
if (!enable_key_output) {
Serial.print(str);
@@ -152,7 +148,7 @@ void loop() {
// Other debug commands.
case '!':
SetupKeyboard();
enable_key_output = !enable_key_output;
break;
case ' ':
// Show sensor status for debugging.