فهرست منبع

Fix audio.pins in keyboard.json not being converted to C defines (#26107)

* Fix audio.pins in keyboard.json not being converted to C defines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix audio.pins in keyboard.json not being converted to C defines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix 'list index out of range' on missing config

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: zvecr <git@zvecr.com>
Yoichiro Tanaka 1 ماه پیش
والد
کامیت
1ef87578e2
3فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 0
      data/mappings/info_config.hjson
  2. 1 1
      lib/python/qmk/cli/generate/config_h.py
  3. 1 1
      lib/python/qmk/cli/generate/rules_mk.py

+ 2 - 0
data/mappings/info_config.hjson

@@ -19,6 +19,8 @@
     // Audio
     // Audio
     "AUDIO_DEFAULT_ON": {"info_key": "audio.default.on", "value_type": "bool"},
     "AUDIO_DEFAULT_ON": {"info_key": "audio.default.on", "value_type": "bool"},
     "AUDIO_DEFAULT_CLICKY_ON": {"info_key": "audio.default.clicky", "value_type": "bool"},
     "AUDIO_DEFAULT_CLICKY_ON": {"info_key": "audio.default.clicky", "value_type": "bool"},
+    "AUDIO_PIN": {"info_key": "audio.pins.0"},
+    "AUDIO_PIN_ALT": {"info_key": "audio.pins.1"},
     "AUDIO_POWER_CONTROL_PIN": {"info_key": "audio.power_control.pin"},
     "AUDIO_POWER_CONTROL_PIN": {"info_key": "audio.power_control.pin"},
     "AUDIO_POWER_CONTROL_PIN_ON_STATE": {"info_key": "audio.power_control.on_state", "value_type": "int" },
     "AUDIO_POWER_CONTROL_PIN_ON_STATE": {"info_key": "audio.power_control.on_state", "value_type": "int" },
     "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "flag"},
     "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "flag"},

+ 1 - 1
lib/python/qmk/cli/generate/config_h.py

@@ -95,7 +95,7 @@ def generate_config_items(kb_info_json, config_h_lines):
 
 
         try:
         try:
             config_value = kb_info_json[info_key]
             config_value = kb_info_json[info_key]
-        except KeyError:
+        except KeyError, IndexError:
             continue
             continue
 
 
         if key_type.startswith('array.array'):
         if key_type.startswith('array.array'):

+ 1 - 1
lib/python/qmk/cli/generate/rules_mk.py

@@ -31,7 +31,7 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict):
 
 
     try:
     try:
         rules_value = kb_info_json[info_key]
         rules_value = kb_info_json[info_key]
-    except KeyError:
+    except KeyError, IndexError:
         return None
         return None
 
 
     if key_type in ['array', 'list']:
     if key_type in ['array', 'list']: