diff options
Diffstat (limited to 'stm32/app/hands.c')
-rw-r--r-- | stm32/app/hands.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/stm32/app/hands.c b/stm32/app/hands.c index 7ac8bb9..8261b1b 100644 --- a/stm32/app/hands.c +++ b/stm32/app/hands.c @@ -9,7 +9,7 @@ static unsigned calc_second_pos (MTIME *m) { uint64_t p; - p += m->second; + p = m->second; p *= 1000; p += m->nanosecond / 1000000; @@ -89,7 +89,13 @@ void hands_tick (void) hands_pos[0] = calc_hour_pos (&m); + +if ((e.s & 31) <5) { + hands_pos[1] =hands_pos[0]; +} else { hands_pos[1] = calc_minute_pos (&m); +} + //hands_pos[1] = calc_second_pos (&m); hands_ready = 1; @@ -101,6 +107,7 @@ void hands_tick (void) } if (p) { + printf("Epoch %d.%09d\r\n",(unsigned) e.s,(unsigned) e.ns); time_print_utc ("UTC: ", &u, NULL); time_print_metric ("Metric: ", &m, NULL); printf ("Hands: hour %4d/%4d min %4d/%4d\r\n", hands_pos[0], MOTOR_STEPS, hands_pos[1], MOTOR_STEPS); |