Commit 63c6a3c8 authored by Adam Wujek's avatar Adam Wujek

monitor: initialize next_update_ticks with now instead of 0

In some rare cases the monitor was not updated when it should.
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent fa477500
Pipeline #4031 passed with stage
in 1 minute and 27 seconds
......@@ -279,6 +279,9 @@ int wrc_mon_gui(void)
uint32_t now;
struct pp_servo *s = SRV(ppg->pp_instances);
/* update on timeout or servo update */
now = timer_get_tics();
/* print new values only if time elapsed or servo's update_count
* increased */
if (prev_gui_description != gui_description) {
......@@ -289,14 +292,12 @@ int wrc_mon_gui(void)
if (gui_description & DESCRIPTION_SERVO) {
print_servo_description();
}
next_update_ticks = 0;
next_update_ticks = now;
term_clear_to_end();
prev_gui_description = gui_description;
return 1;
}
/* update on timeout or servo update */
now = timer_get_tics();
if (time_before(now, next_update_ticks)
&& last_servo_count == s->update_count)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment