1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-11-01 11:16:16 +00:00

Starts adding a keyboard.

This commit is contained in:
Thomas Harte
2021-02-13 23:16:45 -05:00
parent c284b34003
commit 17e9305282
9 changed files with 114 additions and 12 deletions

View File

@@ -42,8 +42,9 @@ void ReactiveDevice::advance_state(double microseconds) {
}
// Advance the implied number of bits.
bit_offset_ += int(microseconds_at_bit_ / 100);
microseconds_at_bit_ -= double(bit_offset_ * 100.0);
const int step = int(microseconds_at_bit_ / 100);
bit_offset_ += step;
microseconds_at_bit_ -= double(step * 100.0);
// Check for end-of-transmission.
if(bit_offset_ >= int(response_.size() * 10)) {