qmk/qmk_firmware

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

Open

#26,106 创建于 2026年3月27日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)C (20,368 star) (43,867 fork)batch import
bughelp wanted

描述

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

贡献者指南