mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-26 09:29:45 +00:00
Comments in slightly more detail.
This commit is contained in:
parent
a5057e6540
commit
1135576a3a
@ -48,13 +48,18 @@ class IntelligentKeyboard:
|
||||
}
|
||||
|
||||
bool serial_line_did_produce_bit(Serial::Line *, int bit) final {
|
||||
// Shift.
|
||||
command_ = (command_ >> 1) | (bit << 9);
|
||||
|
||||
// If that's 10 bits, decode a byte and stop.
|
||||
bit_count_ = (bit_count_ + 1) % 10;
|
||||
if(!bit_count_) {
|
||||
dispatch_command(uint8_t(command_ >> 1));
|
||||
command_ = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Continue.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user