Skip to content

Commit

Permalink
Update spi_lcd_touch_example_main.c
Browse files Browse the repository at this point in the history
Set uint32_t to int32_t. If lv_timer_handler() is called too fast, returns -1. If time_till_next_ms is unsigned, it becomes 0xFFFFFF... (very large). Therefore it overrides the threshold and code locks in usleep().
  • Loading branch information
ostifede02 authored Dec 6, 2024
1 parent a2f420a commit 663b432
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ static void example_increase_lvgl_tick(void *arg)
static void example_lvgl_port_task(void *arg)
{
ESP_LOGI(TAG, "Starting LVGL task");
uint32_t time_till_next_ms = 0;
uint32_t time_threshold_ms = 1000 / CONFIG_FREERTOS_HZ;
int32_t time_till_next_ms = 0;
int32_t time_threshold_ms = 1000 / CONFIG_FREERTOS_HZ;
while (1) {
_lock_acquire(&lvgl_api_lock);
time_till_next_ms = lv_timer_handler();
Expand Down

0 comments on commit 663b432

Please sign in to comment.