Skip to content

Commit 47d456b

Browse files
committed
fix(esp_lvgl_port): Fix task delay calculation for LVGL9
vTaskDelay(1) in the task loop should be taken into account.
1 parent 58633c0 commit 47d456b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

components/esp_lvgl_port/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
- Added display flush wait callback support
77
- Added support for buffered LCD panel (esp_lcd_buffered)
88

9+
### Fixes
10+
- Fixed LVGL9 task delay calculation
11+
912
## 2.6.2
1013

1114
- Changed minimum IDF version to IDF5.1

components/esp_lvgl_port/src/lvgl9/esp_lvgl_port.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -271,8 +271,14 @@ static void lvgl_port_task(void *arg)
271271
task_delay_ms = lvgl_port_ctx.task_max_sleep_ms;
272272
}
273273

274-
/* Minimal dealy for the task. When there is too much events, it takes time for other tasks and interrupts. */
274+
/* Minimal delay for the task. When there is too much events, it takes time for other tasks and interrupts. */
275275
vTaskDelay(1);
276+
/* Adjust delay value returned by lv_timer_handler() accordingly */
277+
if (task_delay_ms >= portTICK_PERIOD_MS) {
278+
task_delay_ms -= portTICK_PERIOD_MS;
279+
} else {
280+
task_delay_ms = 0;
281+
}
276282
}
277283

278284
/* Give semaphore back */

0 commit comments

Comments
 (0)