examples/lvgldemo: Select default demo #1494
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The LVGL Example App
lvgldemo
currently requires 1 argument: the name of the demo to show.In this PR, we propose to make the argument optional if there is only one demo configured. This will enable PINE64 PinePhone to boot straight into
lvgldemo
and auto-start the LVGL App, without entering anynsh
commands.Modified Files
examples/lvgldemo/lvgldemo.c
: If no arguments are specified and only 1 demo exists, select the demoImpact
With this PR,
lvgldemo
will no longer require an argument if there is only one demo configured. So this command:Is equivalent to
lvgldemo widgets
if there is only one demowidgets
configured.If there is more than one demo configured, or if an argument is provided,
lvgldemo
will work the same way as before.Testing
We successfully tested
lvgldemo
with a Single Configured Demo:(See the Test Log)
And we tested
lvgldemo
with Multiple Configured Demos:(See the Test Log)
Also we verified that PinePhone boots successfully to the
lvgldemo widgets
demo automatically, without entering anynsh
commands.(Demo Video)
(Another Demo)
We configured the PinePhone build as follows:
RTOS Features > Tasks and Scheduling
Set "Application entry point" to
lvgldemo_main
(INIT_ENTRYPOINT)
Set "Application entry name" to
lvgldemo_main
(INIT_ENTRYNAME)
Application Configuration > NSH Library
Disable "Have architecture-specific initialization"
(NSH_ARCHINIT)