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

Rework Refresh #497

Merged
merged 8 commits into from
Aug 28, 2021
Merged

Rework Refresh #497

merged 8 commits into from
Aug 28, 2021

Conversation

Riksu9000
Copy link
Contributor

Now that LVGL has more accurate timing, we can use LVGL tasks to refresh apps instead of having DisplayApp do it. Using LVGL tasks to take care of refreshing lets each app choose the refresh rate, or not have it at all. Also it's better when less things are dependent on a task loop.

LVGL for some reason runs all tasks with higher priority again after a task with a lower priority has finished. The screen draw task is LV_TASK_PRIO_MID, so if the refresh task priority is lower than mid, it will redraw the screen. If the screen draw takes longer than the refresh period, the refresh task will be run again, which will run the screen draw again, resulting in an infinite loop and lv_task_handler() never returns. Because of this, the refresh task must be at least LV_TASK_PRIO_MID.

@Avamander
Copy link
Collaborator

Avamander commented Jul 19, 2021

I think it would be better and a smaller patch to simply stop calling some DisplayApp's Refresh() on our own and let LVGL do it. Meaning that instead of a static void refresh(struct _lv_task_t* task) in every watchapp we could have a single one and just call the correct bool Refresh().

@Riksu9000
Copy link
Contributor Author

Riksu9000 commented Jul 19, 2021

I think it would be better and a smaller patch to simply stop calling some DisplayApp's Refresh() on our own and let LVGL do it. Meaning that instead of a static void refresh(struct _lv_task_t* task) in every watchapp we could have a single one and just call the correct bool Refresh().

Good idea. I've now created RefreshTaskCallback(lv_task_t*) in the Screen class. I still wanted to make the Refresh functions void though as the return value doesn't matter any more.

@Riksu9000 Riksu9000 mentioned this pull request Aug 10, 2021
@JF002 JF002 added this to the Version 1.4 milestone Aug 18, 2021
@JF002
Copy link
Collaborator

JF002 commented Aug 28, 2021

@Riksu9000 Thanks for the fast conflict fixing!

@JF002 JF002 merged commit 2870d3a into InfiniTimeOrg:develop Aug 28, 2021
@Riksu9000 Riksu9000 deleted the refresh_rework branch December 5, 2022 19:20
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