@@ -131,7 +131,7 @@ void showDigits(tube4_t dig)
}
void lShiftDigits(const tube4_t old, const tube4_t dig) {
- tube4_t buf;
+ uint32_t * buf;
uint8_t sbuf[12];
sbuf[0] = dig.ar[0];
@@ -148,12 +148,9 @@ void lShiftDigits(const tube4_t old, const tube4_t dig) {
sbuf[11] = old.ar[3];
int i;
- for (i=11; i>2; i--) {
- buf.ar[3] = sbuf[i];
- buf.ar[2] = sbuf[i-1];
- buf.ar[1] = sbuf[i-2];
- buf.ar[0] = sbuf[i-3];
- _show_digits(buf.u32);
+ for (i=8; i>=0; i--) {
+ buf = (uint32_t *)&sbuf[i];
+ _show_digits(*buf);
tdelay_ms(100);