diff --git a/driver.fzz b/driver.fzz index 94930c8..405d281 100644 Binary files a/driver.fzz and b/driver.fzz differ diff --git a/main.c b/main.c index 617c12c..5c5403a 100644 --- a/main.c +++ b/main.c @@ -96,9 +96,15 @@ write_num(uint16_t number, int digits) int i; for (i = 0; i < digits; i += 1) { - uint16_t n = (number / divisor) % 10; + uint16_t n = number / divisor; + uint8_t out = seven_segment_digits[n % 10]; + + // Overflow indicator + if (n > 9) { + out ^= 0x80; + } - write(seven_segment_digits[n]); + write(out); divisor *= 10; } } @@ -140,9 +146,7 @@ draw() write_num(score_a, 2); - write_num(jiffies % 10, 1); - write_num(jiffies % 10, 1); - + write_num(jiffies % 200, 2); latch(); pulse(); @@ -211,7 +215,7 @@ update_controller() if (jiffies - last_change > 10) { v = cur; - } + } if (v & BTN_UP) { period_clock -= 10; }