Skip to content

Refactor display handling - #60

Merged
RomanAlexandroff merged 3 commits into
mainfrom
refactor_display_handling
Aug 23, 2026
Merged

RomanAlexandroff merged 3 commits into
mainfrom
refactor_display_handling

Conversation

@RomanAlexandroff

Copy link
Copy Markdown
Owner

Summary

This PR refactors display rendering into a single unified draw_on_display(IMAGE_t) API. It centralises display state tracking, prevents repeated redraws of unchanged images and routes cluster, exam, OTA, battery, and Telegram/error display updates through the same display-handling flow. Now display handling logic is much more straightforward, easy to understand and support. Resolves #28

It also fixes pre-exam handling so the device does not enter a long blocking synchronisation wait when exam mode is reached too early.

Notes

  • Added a display state/cache layer for cluster, exam, and blank display views.
  • Moved full-screen exam rendering into the shared display handling logic.
  • Updated display call sites to use the new unified API.
  • Cleaned up display-related debug messages so they are handled inside the display module.
  • Added a guard against starting pre-exam synchronisation too early.

@RomanAlexandroff RomanAlexandroff left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor finding: RTC cache variables are defined in the display_handling.h header. Safe only if the header is never included elsewhere, but fragile.

Overall: display refactor looks much better. There're more functions now than before, but each one of them is responsible for its own single thing instead of how all the logic used to be wildly stuffed in one overloaded function. Drawing images in the Exam mode used to live in its "separate world" from the Cluster number mode, but now everything goes through the same logic.

@RomanAlexandroff
RomanAlexandroff merged commit 37d94c0 into main Aug 23, 2026
3 of 4 checks passed
@RomanAlexandroff
RomanAlexandroff deleted the refactor_display_handling branch August 23, 2026 16:47
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.

[Issue] display_cluster_number() has an overwhelmingly dense logic

1 participant