Skip to content

feat(display): Remove display task to instead have lvgl handle it directly#400

Merged
finger563 merged 4 commits intoesp-cpp:mainfrom
smartknob-ha:feat/display_freertos
Mar 9, 2025
Merged

feat(display): Remove display task to instead have lvgl handle it directly#400
finger563 merged 4 commits intoesp-cpp:mainfrom
smartknob-ha:feat/display_freertos

Conversation

@abrondijk
Copy link
Contributor

@abrondijk abrondijk commented Mar 7, 2025

Description

This change removes the update task entirely from the display component, as lvgl can now retrieve its own task ticks.

It also sets the delay callback, so that it can actually delay, rather than doing this.
This should be much more efficient.

Potential downside is that the pause and resume functions can no longer do anything.
The user could still "pause" lvgl by not calling lv_timer_handler().

Motivation and Context

General performance improvements. On programs that actually have a lot of tasks running, the delay callback should free up quite some cpu time.

How has this been tested?

Tested on the Lilygo T-Encoder-Pro and Smartknob-HA.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Hardware

  • I have updated the design files (schematic, board, libraries).
  • I have attached the PDFs of the SCH / BRD to this PR
  • I have updated the design output (GERBER, BOM) files.

@github-actions
Copy link

github-actions bot commented Mar 7, 2025

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-requested a review March 8, 2025 03:26
@finger563 finger563 added enhancement New feature or request display labels Mar 8, 2025
@finger563
Copy link
Contributor

I've tested this locally within the esp-box-emu project, and simply calling the existing gui.pause() and menu.pause() (which we had to anyway) is sufficient to allow direct rendering of emulator to screen for direct mode. Can still easily switch back and forth between lvgl and emulator so this works well in my testing 🚀

Please fix the broken examples, then I think this will be good.

@finger563 finger563 changed the title Feat/display freertos feat(display): Remove display task to instead have lvgl handle it directly Mar 9, 2025
@finger563 finger563 merged commit 44ff49b into esp-cpp:main Mar 9, 2025
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

display enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants