qmk/qmk_firmware

[Bug] audio.pins in keyboard.json is not converted to C defines during build

已關閉

#26,106 建立於 2026年3月27日

 (2 則留言) (0 個反應) (0 位負責人)C (43,867 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (20,368 顆星)
PR 合併指標
 (平均合併 20天 9小時) (30 天內合併 27 個 PR)

描述

Bug Description

The audio.pins property defined in keyboard.json is not converted to AUDIO_PIN / AUDIO_PIN_ALT C defines during the build process, even though it is a valid property in the keyboard JSON schema.

Expected Behavior

When audio.pins is specified in keyboard.json, the build system should generate the corresponding AUDIO_PIN and AUDIO_PIN_ALT defines in info_config.h, similar to how other audio.* properties are handled.

Actual Behavior

The audio.pins value is silently ignored during build. Users must still manually define AUDIO_PIN / AUDIO_PIN_ALT in config.h for audio to work.

Details

  • The JSON schema (data/schemas/keyboard.jsonschema) defines audio.pins as a valid mcu_pin_array.
  • All other audio.* properties have mappings in data/mappings/info_config.hjson and are correctly converted to C defines via generate_config_items() in lib/python/qmk/cli/generate/config_h.py.
  • The reverse direction (config.h → keyboard.json) works correctly: _extract_audio() in lib/python/qmk/info.py reads legacy B5_AUDIO, B6_AUDIO, etc. and populates audio.pins.
  • However, audio.pins has no entry in info_config.hjson, so the forward direction (keyboard.json → C defines) is missing.

Affected Properties

Property keyboard.json → C config.h → keyboard.json
audio.default.on
audio.default.clicky
audio.driver ✅ (rules.mk)
audio.power_control.pin
audio.power_control.on_state
audio.voices
audio.macro_beep
audio.pins ❌ Missing

貢獻者指南