Repository navigation
Conversation
This was referenced Aug 25, 2026
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.
Important
This is part 3 of 3 split from #24. It is intentionally opened as a draft and is currently stacked on #25 and #26, so GitHub shows their prerequisite commits too. The RGB implementation itself is commit
b074559. I will rebase it ontodevafter the prerequisites land and will not mark it ready before the resulting RGB-only diff is green.Context
This draft addresses #6 and is opened early so the architecture can be discussed before merge, especially the maintainer's concerns about scan-loop performance, current draw, and the difference between per-key RGB and underglow.
Scope
Performance concern
RGB is compile-time opt-in. A keyboard without an
rgbmetadata block does not compile the renderer/backend, allocate frame buffers, or schedulergb_task().The portable layer never bit-bangs LEDs.
rgb_backend_submit()must copy/queue a frame and return immediately; the STM32F723 backend uses timer DMA and completes asynchronously. Animation and transfer cadence are separate from matrix scanning. Host live frames are assembled in staging memory and become visible atomically only after every 60-byte chunk arrives, so partial/late packets cannot tear the active frame.The draft has strict host tests for effect math and topology and has been built both with RGB enabled on KBHE and disabled on an existing HE60 target. Before ready-for-review, the rebased branch will be remeasured against the final prerequisite commits.
Current-draw concern
Brightness is a board-owned setting applied in the core before submission. KBHE deliberately defaults to 50/255 rather than full output. Suspend sends a black frame and pauses animation. Live frames cannot bypass the global brightness scaling.
This draft does not claim to provide an electrical current measurement or a universal safe current limit: that limit depends on LED type, count, PCB power path and USB budget. I would like maintainer feedback on whether the schema should also require a board-specific hard maximum in addition to the conservative default before this leaves draft.
Per-key versus underglow
The renderer is not tied to the KBHE serpentine chain. Metadata separates:
led_index_map);led_position);key_to_led).KBHE uses one LED per key. The separation is intended to let an underglow board describe LEDs that have positions but no key association, without creating a second renderer/backend API. This is another point where feedback is welcome while the PR is draft.
HID/API design
Hosts must first call
GET_RGB_CAPABILITIES(0x7F) rather than infer RGB support from a firmware version. Basic effect and brightness commands are small fixed reports. Live per-LED control uses chunked 64-byte RAW HID reports and publishes only complete frames. No live frame is written to Flash, avoiding wear and input stalls.Validation completed on the isolated stack
Dependency/rebase plan
dev, resolve metadata migrations once, rerun host and both target builds, then replace the measurements above and mark ready.Until then, please treat this as an architecture/RFC draft rather than a merge candidate.