Skip to content

Commit

Permalink
lvgldemo: allow to customize input dev path
Browse files Browse the repository at this point in the history
Default to /dev/input0, now it's configurable.

Signed-off-by: Neo Xu <[email protected]>
  • Loading branch information
XuNeo committed Oct 26, 2024
1 parent 1506c6f commit b20cccc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/lvgldemo/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions examples/lvgldemo/lvgldemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b20cccc

Please sign in to comment.