From b20cccc463e7f4d10e4201bc072e88c02626d30a 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 | 10 ++++++++++ examples/lvgldemo/lvgldemo.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/examples/lvgldemo/Kconfig b/examples/lvgldemo/Kconfig index 00f6b250f8..89f38c009a 100644 --- a/examples/lvgldemo/Kconfig +++ b/examples/lvgldemo/Kconfig @@ -20,4 +20,14 @@ config EXAMPLES_LVGLDEMO_STACKSIZE int "lvgldemo stack size" default 16384 +if INPUT_TOUCHSCREEN + +config EXAMPLES_LVGLDEMO_INPUT_DEVPATH + string "Touchscreen device path" + default "/dev/input0" + ---help--- + The path to the touchscreen device. Default: "/dev/input0" + +endif # INPUT_TOUCHSCREEN + 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)