Switch driver to TPIC
This commit is contained in:
parent
b7660d347a
commit
c4a6023e95
BIN
driver.fzz
BIN
driver.fzz
Binary file not shown.
14
main.c
14
main.c
|
@ -96,9 +96,15 @@ write_num(uint16_t number, int digits)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < digits; i += 1) {
|
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];
|
||||||
|
|
||||||
write(seven_segment_digits[n]);
|
// Overflow indicator
|
||||||
|
if (n > 9) {
|
||||||
|
out ^= 0x80;
|
||||||
|
}
|
||||||
|
|
||||||
|
write(out);
|
||||||
divisor *= 10;
|
divisor *= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,9 +146,7 @@ draw()
|
||||||
|
|
||||||
write_num(score_a, 2);
|
write_num(score_a, 2);
|
||||||
|
|
||||||
write_num(jiffies % 10, 1);
|
write_num(jiffies % 200, 2);
|
||||||
write_num(jiffies % 10, 1);
|
|
||||||
|
|
||||||
|
|
||||||
latch();
|
latch();
|
||||||
pulse();
|
pulse();
|
||||||
|
|
Loading…
Reference in New Issue