mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 01:31:42 +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