diff options
author | Devaev Maxim <[email protected]> | 2018-09-29 09:07:12 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-09-29 09:07:12 +0300 |
commit | e95e560bdffd96dbe80593a15a4a06981ebe7e4c (patch) | |
tree | b98848c74a3e0b5197f8a73195522688a4afc028 /hid | |
parent | 610cabfff46fb58d12bb07ff06de49e09ddd08ff (diff) |
hid: readNoop()
Diffstat (limited to 'hid')
-rw-r--r-- | hid/src/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hid/src/main.cpp b/hid/src/main.cpp index 9fad576c..93a90b8b 100644 --- a/hid/src/main.cpp +++ b/hid/src/main.cpp @@ -17,11 +17,14 @@ // ----------------------------------------------------------------------------- +INLINE void readNoop() { + for (int count = 0; count < 4; ++count) { + CMD_SERIAL.read(); + } +} + INLINE void cmdResetHid() { // 0 bytes - CMD_SERIAL.read(); // unused - CMD_SERIAL.read(); // unused - CMD_SERIAL.read(); // unused - CMD_SERIAL.read(); // unused + readNoop(); BootKeyboard.releaseAll(); SingleAbsoluteMouse.releaseAll(); } @@ -96,7 +99,7 @@ void loop() { case 2: cmdMouseMoveEvent(); break; case 3: cmdMouseButtonEvent(); break; case 4: cmdMouseWheelEvent(); break; - default: break; + default: readNoop(); break; } cmd_processed = true; } |