mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-08 16:53:28 +03:00
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:
committed by
Takashi Toyoshima
parent
3561e299ce
commit
6f8ee87e94
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user