From 09db513e887e1819e3119e6a3e7a919968860512 Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Sun, 27 Oct 2024 01:49:00 +0800 Subject: [PATCH] lvgldemo: allow to customize input dev path Default to /dev/input0, now it's configurable. Signed-off-by: Neo Xu --- examples/lvgldemo/Kconfig | 7 +++++++ examples/lvgldemo/lvgldemo.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/examples/lvgldemo/Kconfig b/examples/lvgldemo/Kconfig index 00f6b250f8..dfe26f1e04 100644 --- a/examples/lvgldemo/Kconfig +++ b/examples/lvgldemo/Kconfig @@ -20,4 +20,11 @@ config EXAMPLES_LVGLDEMO_STACKSIZE int "lvgldemo stack size" default 16384 +config EXAMPLES_LVGLDEMO_INPUT_DEVPATH + string "Touchscreen device path" + default "/dev/input0" + depends on INPUT_TOUCHSCREEN + ---help--- + The path to the touchscreen device. Default: "/dev/input0" + endif # EXAMPLES_LVGLDEMO diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 15fb906b0f..7f15bc7be8 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -129,6 +129,10 @@ int main(int argc, FAR char *argv[]) info.fb_path = "/dev/lcd0"; #endif +#ifdef CONFIG_INPUT_TOUCHSCREEN + info.input_path = CONFIG_EXAMPLES_LVGLDEMO_INPUT_DEVPATH; +#endif + lv_nuttx_init(&info, &result); if (result.disp == NULL)