Consolidate Widget draw and update frequency management #295
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs#295
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We have a lot of very similar code across the widgets for managing timers for knowing when to update data and draw screens. One effect of this is that the active widget gets its draw() and update() methods called every time thru the main loop and sometimes this is the desired effect but most of the time they do nothing (or nothing meaningful) and return. This code could be extrapolated out into the Widget.cpp. And WidgetSet can use these widget-based timers to know when it needs to call the draw() and update() methods. This has several benefits:
Example widget code:
And your timers can be reset if needed:
Also we could specify timers values like this
Which would allow people to override the defaults in the config if they wanted.
We could implement this today and use for just one widget to try it out and if it seems beneficial roll it to all the widgets.
PR #297
changes merged