Add per-profile SOCD cleaning settings to address #1187 - #1692
Open
j-zhao wants to merge 1 commit into
Open
Conversation
j-zhao
marked this pull request as ready for review
August 12, 2026 22:24
j-zhao
force-pushed
the
worktree-1187-profile-extension
branch
from
August 13, 2026 16:42
74d308e to
3c17884
Compare
Each profile can override the global SOCD mode. Addresses the SOCD portion of OpenStickCommunity#1187. - Add ProfileSettings message (socdEnabled, socdMode) as GpioMappings.settings field 5; field 4 stays reserved for OpenStickCommunity#1566. - Resolve SOCD mode as: slider addon > profile override > global. - SOCD hotkeys write to the effective source and never create an override; skipped while the slider addon owns the mode. - The on-device display menu reads and writes the SOCD mode through the same profile-aware routing as the hotkeys. - Web API: socdEnabled/socdMode on get/setPinMappings and get/setProfileOptions, presence-guarded and range-checked; raise getProfileOptions JSON capacity for the added fields. - Web UI: per-profile SOCD dropdown on the Pin Mapping page with a "Use global setting" option and a slider-addon note. - Copy webconfig response data in tcp_write; the zero-copy default can transmit freed heap memory (exposed by this change on device).
j-zhao
force-pushed
the
worktree-1187-profile-extension
branch
from
August 13, 2026 17:01
3c17884 to
2e7d094
Compare
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.
Addresses the SOCD portion of #1187.
Full disclosure, this was specced out with Claude Fable, with first initial review by myself.
Summary
Each profile can now override the global SOCD cleaning mode. A profile without an override uses the global setting, exactly as before. The Pin Mapping page gets a per-profile SOCD dropdown.
ProfileSettings { socdEnabled, socdMode }asGpioMappings.settings(field 5; field 4 stays reserved for feat: Add per-profile keyboard mapping and per-pin GPIO polarity support #1566).socdEnabled == falsemeans "use the global setting".socdEnabled/socdMode. Setters apply the keys only when present and in range, so older payloads leave stored overrides unchanged.getProfileOptionsJSON capacity grows 500 -> 700 slots (the old budget overflowed at 4+ profiles with the new keys).Web server fix
On-device testing exposed a latent webconfig bug: API responses are heap strings freed on connection close, but lwIP's httpd queues data by reference (assuming ROM), so a freed buffer can hit the wire as garbage. Fixed by setting
HTTP_IS_DATA_VOLATILEtoTCP_WRITE_FLAG_COPYinlib/lwip-port/lwipopts.h. This may also fix rare corrupted webconfig responses on current firmware.Design notes
ProfileOptions, but profile 1 lives outside it (config.gpioMappings), so the settings nest underGpioMappingsto give every profile the same shape.Config_size21267 -> 21303 (+36 bytes, budget 32756); no migration.Testing
CI: all boards compile (fork run). Local: nanopb regen,
npm run build-proto,npx vite build.On-device checklist: