Skip to content

fix: skip full-canvas redraw on WPM ticks when no WPM visual is drawn on the canvas - #33

Open
delneet wants to merge 1 commit into
mctechnology17:mainfrom
delneet:fix/wpm-canvas-redraw
Open

delneet wants to merge 1 commit into
mctechnology17:mainfrom
delneet:fix/wpm-canvas-redraw

Conversation

@delneet

@delneet delneet commented Jul 3, 2026

Copy link
Copy Markdown

Problem

When only Luna or Bongo Cat is enabled (WPM_NUMBER, WPM_SPEEDOMETER and WPM_GRAPH all n — the shipped defaults), draw_wpm_status() draws nothing, but screen.c still subscribes the whole status screen to zmk_wpm_state_changed. Result: roughly once per second while typing, the entire canvas is redrawn and software-rotated (rotate_canvas) for no visual change. On a split central that CPU time competes with key scanning and BLE, and it shows up as typing lag.

Change

The full-canvas WPM listener, its init, and the draw_wpm_status() call are now compiled only when at least one canvas WPM visual (WPM_NUMBER / WPM_SPEEDOMETER / WPM_GRAPH) is enabled. Luna and Bongo Cat are unaffected: they are standalone lv_animimg widgets fed directly by the WPM event and update only their own area.

No behavior change for anyone who has a WPM visual enabled. docs/OPTIMIZE.md gains a section describing the "Luna without the counter" setup, and CHANGELOG.txt is updated.

Verification

Built against ZMK v0.3.0 (nice_nano_v2, corne_left/corne_right nice_oled):

  • default config (Bongo Cat, no WPM visuals) — listener compiled out, builds clean
  • Luna-only config — builds clean
  • config with WPM_NUMBER=y — listener still compiled in
20260703_113510.mp4

… on the canvas

With only Luna or Bongo Cat enabled (WPM_NUMBER, WPM_SPEEDOMETER and
WPM_GRAPH all disabled) draw_wpm_status() draws nothing, yet the screen
widget still subscribed to zmk_wpm_state_changed and redrew + software
rotated the whole canvas roughly once per second while typing. The
listener and the draw call are now compiled only when one of the canvas
WPM visuals is enabled. Luna/Bongo Cat keep working: they are standalone
lv_animimg widgets fed directly by the WPM event.
@delneet
delneet marked this pull request as ready for review July 3, 2026 09:40
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.

1 participant