Skip to content

Throttle live display redraws - #17

Merged
PurpleSentinel merged 1 commit into
v3from
feature/issue-10-throttle-live-display
Aug 9, 2026
Merged

Throttle live display redraws#17
PurpleSentinel merged 1 commit into
v3from
feature/issue-10-throttle-live-display

Conversation

@PurpleSentinel

Copy link
Copy Markdown
Contributor

Summary

  • compare the complete visible live-session frame and redraw only when its displayed second, warning state, or another visible value changes
  • poll stop and clear gestures every 50 ms between redraws
  • share one throttled loop across track and rest sessions
  • cache the CST816T mode so unchanged frames do not rewrite touch-controller registers
  • document measured display and input responsiveness and include the new module in installation instructions

Root cause

The track and rest loops previously cleared and transferred the complete 115,200-byte framebuffer on every unbounded iteration. They also called Set_Mode() for every live frame, producing needless SPI traffic, I2C writes, CPU use, and contention even though the visible timers generally change once per second.

Validation

  • python3 -m unittest discover -s tests -v — 48 tests passed
  • a simulated six-second session produced exactly six redraws while input remained continuously polled
  • warning-state changes redraw even when the visible time strings are unchanged
  • repeated unchanged touch modes produce no additional register writes
  • on the connected Waveshare board, five full redraws measured 56.2–65.4 ms
  • measured input polling is 50 ms normally and approximately 115 ms worst-case during a redraw
  • a real three-second MicroPython session produced exactly three redraws and 49 input checks
  • five hardware frames produced only the two initial gesture-mode register writes

Fixes #10

@PurpleSentinel
PurpleSentinel merged commit 25aecfc into v3 Aug 9, 2026
2 checks passed
@PurpleSentinel
PurpleSentinel deleted the feature/issue-10-throttle-live-display branch August 9, 2026 22:08
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.

Throttle live-screen redraws to timer changes

2 participants