Skip to content

Commit

Permalink
some devices crash with esp timer stack error
Browse files Browse the repository at this point in the history
  • Loading branch information
mverch67 committed Dec 9, 2024
1 parent 89633a6 commit d726bba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/TFTDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ template <class TFT> void TFTDriver<TFT>::init(DeviceGUI *gui)
DisplayDriver::init(gui);

#ifdef ARCH_ESP32
#ifdef DONT_USE_ESP_TIMER
lv_tick_set_cb(xTaskGetTickCount);
#else
// Create esp timer to call lvgl lv_tick_inc()
const esp_timer_create_args_t lvgl_tick_timer_args = {.callback = [](void *arg) { lv_tick_inc(1); }, .name = "lvgl_tick"};
esp_timer_handle_t lvgl_tick_timer = nullptr;
ESP_ERROR_CHECK(esp_timer_create(&lvgl_tick_timer_args, &lvgl_tick_timer));
ESP_ERROR_CHECK(esp_timer_start_periodic(lvgl_tick_timer, 1000));
#endif
#elif defined(ARCH_PORTDUINO)
lv_tick_set_cb([]() -> uint32_t { return millis(); });
#endif
Expand Down

0 comments on commit d726bba

Please sign in to comment.