feat: CONFIG_NICE_OLED_EXTERNAL_WIDGET — let external modules add widgets to the peripheral screen - #35
Open
delneet wants to merge 2 commits into
Open
Conversation
When enabled, the peripheral screen init calls nice_oled_external_widget_init(parent), which another Zephyr module provides (e.g. zmk-peripheral-animations for runtime-rendered animations). Off by default; enabling it without a providing module fails at link time by design. This generalizes the USER animation slot: external modules can draw anything on the peripheral screen without forking this repo.
delneet
force-pushed
the
feat/peripheral-user-animation
branch
from
July 3, 2026 12:38
f4bed33 to
5fd2f9b
Compare
With both NICE_OLED_WIDGET_ANIMATION_PERIPHERAL=n and NICE_OLED_WIDGET_STATIC_IMAGE_PERIPHERAL=n, draw_animation() was still called and fell through to a random crystal frame, so the peripheral art could never be turned off. It is now only drawn when one of the two options is enabled — required when handing the area to an external widget module.
delneet
marked this pull request as ready for review
August 26, 2026 09:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
CONFIG_NICE_OLED_EXTERNAL_WIDGET: an optional hook that lets a separate Zephyr module add a widget to the peripheral screen without forking this repo. When enabled, peripheral screen init calls:which the external module provides. That's the whole interface — 18 lines including Kconfig and CHANGELOG.
CONFIG_NICE_OLED_WIDGET_ANIMATION_PERIPHERAL=n/..._STATIC_IMAGE_PERIPHERAL=nto hand the animation area over.Why
Addresses the "More animations and fixed images for periphery" TODO without growing this repo: animation content can live in its own modules and evolve independently. First consumer: zmk-peripheral-animations — 10 procedurally rendered effects (plasma, rule 30, Sierpinski zoom, starfield, matrix rain, wireframe cube, …) computed live on the MCU, ~1-2 KB code each instead of stored frames.
Verification
Built against ZMK v0.3.0 (
nice_nano_v2,corne_right nice_oled):