Browse Source

fix(display): Check for display in idle handler.

* Closes #679
xmkb
Pete Johanson 4 years ago
parent
commit
ff7891c097
  1. 8
      app/src/display/main.c

8
app/src/display/main.c

@ -38,12 +38,20 @@ void display_timer_cb() { k_work_submit(&display_tick_work); }
K_TIMER_DEFINE(display_timer, display_timer_cb, NULL); K_TIMER_DEFINE(display_timer, display_timer_cb, NULL);
static void start_display_updates() { static void start_display_updates() {
if (display == NULL) {
return;
}
display_blanking_off(display); display_blanking_off(display);
k_timer_start(&display_timer, K_MSEC(10), K_MSEC(10)); k_timer_start(&display_timer, K_MSEC(10), K_MSEC(10));
} }
static void stop_display_updates() { static void stop_display_updates() {
if (display == NULL) {
return;
}
display_blanking_on(display); display_blanking_on(display);
k_timer_stop(&display_timer); k_timer_stop(&display_timer);

Loading…
Cancel
Save