From 7b73c784ab919db6bb40397e5840eb1716ce45fb Mon Sep 17 00:00:00 2001 From: bjsylvia Date: Fri, 29 Dec 2023 17:49:59 +0800 Subject: [PATCH] chore(docs): sync indev docs with the latest code (#5129) Signed-off-by: YanXiaowei Co-authored-by: YanXiaowei --- docs/porting/indev.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/porting/indev.rst b/docs/porting/indev.rst index c428cb6a7..a751a898b 100644 --- a/docs/porting/indev.rst +++ b/docs/porting/indev.rst @@ -232,8 +232,8 @@ data instead of directly reading the input device. Setting the ``data->continue_reading`` flag will tell LVGL there is more data to read and it should call ``read_cb`` again. -Decoupling the input device read timer --------------------------------------- +Switching the input device to event-driven mode +----------------------------------------------- Normally the input event is read every :c:macro:`LV_DEF_REFR_PERIOD` milliseconds (set in ``lv_conf.h``). However, in some cases, you might @@ -244,10 +244,10 @@ You can do this in the following way: .. code:: c - /*Delete the original input device read timer*/ - lv_timer_delete(indev->read_timer); - indev->read_timer = NULL; + /*Update the input device's running mode to LV_INDEV_MODE_EVENT*/ + lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); + ... /*Call this anywhere you want to read the input device*/ lv_indev_read(indev);