Skip to content

feat(mic): add runtime-configurable microphone pins to brucePins.conf - #2319

Draft
pfefferle wants to merge 1 commit into
BruceDevices:devfrom
pfefferle:feat/configurable-mic-pins
Draft

feat(mic): add runtime-configurable microphone pins to brucePins.conf#2319
pfefferle wants to merge 1 commit into
BruceDevices:devfrom
pfefferle:feat/configurable-mic-pins

Conversation

@pfefferle

Copy link
Copy Markdown
Contributor

Summary

  • Add micClk and micData fields to BruceConfigPins, defaulting to the board's compile-time PIN_CLK/PIN_DATA values
  • Serialize/deserialize mic pins in /brucePins.conf JSON
  • Add "Mic Pins" menu entry in Dev Mode (Config > Dev Mode > Mic Pins)
  • Update mic.cpp to read pins from bruceConfigPins at runtime instead of compile-time macros

Closes #2281

Test plan

  • Verify default mic pins match board defaults (no behavior change without user action)
  • Verify Mic Pins menu shows CLK/DATA values and allows changing them
  • Verify changed pins persist across reboot via brucePins.conf
  • Test mic recording works with custom pin assignment on Cardputer ADV expansion port

@pfefferle
pfefferle force-pushed the feat/configurable-mic-pins branch from 0cf8934 to d56e642 Compare July 14, 2026 11:32
Closes BruceDevices#2281

- Add an I2SPins struct and a mic_bus member to BruceConfigPins, defaulting
  to the board's PIN_CLK/PIN_DATA (falling back to "no pin" on boards that
  don't define them), matching the existing bus-config convention used by
  i2c_bus, gps_bus, CC1101_bus, etc.
- Serialize/deserialize mic_bus as a nested "Mic_Pins" object in brucePins.conf
- Add a single setMicPins(I2SPins) setter that saves the config once
- Add a "Mic Pins" menu entry in Dev Mode for CLK and DATA pin selection,
  mirroring the shared pin-picker menus (setI2CPinsMenu/setUARTPinsMenu)
- Update mic.cpp to read pins from bruceConfigPins.mic_bus at runtime instead
  of using compile-time macros directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants