Switch driver to TPIC

This commit is contained in:
Neale Pickett 2013-07-15 20:56:29 -06:00
parent b7660d347a
commit c4a6023e95
2 changed files with 10 additions and 6 deletions

Binary file not shown.

14
main.c
View File

@ -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();