Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/lvgldemo: Select default demo #1494

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

lupyuen
Copy link
Member

@lupyuen lupyuen commented Jan 16, 2023

Summary

The LVGL Example App lvgldemo currently requires 1 argument: the name of the demo to show.

lvgldemo widgets

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 any nsh commands.

Modified Files

examples/lvgldemo/lvgldemo.c: If no arguments are specified and only 1 demo exists, select the demo

Impact

With this PR, lvgldemo will no longer require an argument if there is only one demo configured. So this command:

lvgldemo

Is equivalent to lvgldemo widgets if there is only one demo widgets 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:

lvgldemo
  [Shows Widgets Demo]
lvgldemo widgets
  [Shows Widgets Demo]

(See the Test Log)

And we tested lvgldemo with Multiple Configured Demos:

lvgldemo
  [Shows List of Configured Demos and exits]
lvgldemo music
  [Shows Music Demo]
lvgldemo stress
  [Shows Stress Demo]

(See the Test Log)

Also we verified that PinePhone boots successfully to the lvgldemo widgets demo automatically, without entering any nsh commands.

(Demo Video)

(Another Demo)

We configured the PinePhone build as follows:

tools/configure.sh pinephone:lvgl
make menuconfig
  1. RTOS Features > Tasks and Scheduling

    • Set "Application entry point" to lvgldemo_main

      (INIT_ENTRYPOINT)

    • Set "Application entry name" to lvgldemo_main

      (INIT_ENTRYNAME)

  2. Application Configuration > NSH Library

    • Disable "Have architecture-specific initialization"

      (NSH_ARCHINIT)

The LVGL Example App `lvgldemo` currently requires 1 argument: the name of the demo to show.

```bash
lvgldemo widgets
```

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 any `nsh` commands.

### Modified Files

`examples/lvgldemo/lvgldemo.c`: If no arguments are specified and only 1 demo exists, select the demo
@xiaoxiang781216 xiaoxiang781216 merged commit 757fc30 into apache:master Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants