1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/lvgl: use ztimer instead of xtimer

This commit is contained in:
Francisco Molina 2021-10-21 18:16:46 +02:00
parent c9f4d11c52
commit a4dd3c0147
6 changed files with 12 additions and 11 deletions

View File

@ -31,7 +31,8 @@ config MODULE_LVGL_CONTRIB
bool "Contrib"
select MODULE_DISP_DEV
select MODULE_CORE_THREAD_FLAGS
select MODULE_XTIMER
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
config MODULE_LVGL_CONTRIB_TOUCH
bool "Touch support"

View File

@ -10,7 +10,8 @@ USEMODULE += lvgl_widgets
ifneq (,$(filter lvgl_contrib,$(USEMODULE)))
USEMODULE += disp_dev
USEMODULE += core_thread_flags
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec
endif
ifneq (,$(filter lvgl_contrib_touch,$(USEMODULE)))

View File

@ -22,7 +22,8 @@
#include "kernel_defines.h"
#include "thread.h"
#include "xtimer.h"
#include "timex.h"
#include "ztimer.h"
#include "log.h"
#include "lvgl/lvgl.h"
@ -38,8 +39,8 @@
#define CONFIG_LVGL_INACTIVITY_PERIOD_MS (5 * MS_PER_SEC) /* 5s */
#endif
#ifndef CONFIG_LVGL_TASK_HANDLER_DELAY_US
#define CONFIG_LVGL_TASK_HANDLER_DELAY_US (5 * US_PER_MS) /* 5ms */
#ifndef CONFIG_LVGL_TASK_HANDLER_DELAY_MS
#define CONFIG_LVGL_TASK_HANDLER_DELAY_MS (5) /* 5ms */
#endif
#ifndef LVGL_THREAD_FLAG
@ -146,7 +147,7 @@ void lvgl_run(void)
lv_disp_trig_activity(NULL);
}
xtimer_usleep(CONFIG_LVGL_TASK_HANDLER_DELAY_US);
ztimer_sleep(ZTIMER_MSEC, CONFIG_LVGL_TASK_HANDLER_DELAY_MS);
}
}

View File

@ -15,7 +15,7 @@ LVGL_TASK_THREAD_PRIO cannot be configured via Kconfig.
- `CONFIG_LVGL_INACTIVITY_PERIOD_MS`: maximum inactivity period before going to sleep in ms.
(default: 5s)
- `CONFIG_LVGL_TASK_HANDLER_DELAY_US`: delay between lvgl task handle call in us.
- `CONFIG_LVGL_TASK_HANDLER_DELAY_MS`: delay between lvgl task handle call in us.
(default: 5ms)
- `LVGL_TASK_THREAD_PRIO`: lvgl task handler thread priority.
(default: THREAD_PRIORITY_MAIN - 1)

View File

@ -28,8 +28,8 @@ typedef int16_t lv_coord_t;
#define LV_TICK_CUSTOM 1
#if LV_TICK_CUSTOM == 1
#define LV_TICK_CUSTOM_INCLUDE "xtimer.h" /*Header for the sys time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (xtimer_now_usec() / US_PER_MS) /*Expression evaluating to current systime in ms*/
#define LV_TICK_CUSTOM_INCLUDE "ztimer.h" /*Header for the sys time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (ztimer_now(ZTIMER_MSEC)) /*Expression evaluating to current systime in ms*/
#endif /*LV_TICK_CUSTOM*/
#ifdef __cplusplus

View File

@ -20,8 +20,6 @@
#include <string.h>
#include "xtimer.h"
#include "lvgl/lvgl.h"
#include "lvgl_riot.h"
#include "disp_dev.h"