This commit is contained in:
Zach White 2021-09-05 10:54:33 -07:00
parent 0b1dee6c50
commit c13ce5479c
4 changed files with 89 additions and 1 deletions

View file

@ -12,6 +12,25 @@ from qmk.keymap import locate_keymap
from qmk.path import normpath
def audio_pins(audio):
"""Return the config.h lines to configure audio.
"""
config_h = []
if 'pins' in audio:
if len(audio['pins']) > 0:
config_h.append('#ifndef AUDIO_PIN')
config_h.append(f'# define AUDIO_PIN f{audio["pins"][0]}')
config_h.append('#endif // AUDIO_PIN')
if len(audio['pins']) > 1:
config_h.append('#ifndef AUDIO_PIN_ALT')
config_h.append(f'# define AUDIO_PIN_ALT f{audio["pins"][1]}')
config_h.append('#endif // AUDIO_PIN_ALT')
return '\n'.join(config_h)
def direct_pins(direct_pins, postfix):
"""Return the config.h lines that set the direct pins.
"""

View file

@ -193,7 +193,7 @@ def _extract_audio(info_data, config_c):
audio_pins = []
for pin in 'B5', 'B6', 'B7', 'C4', 'C5', 'C6':
if config_c.get(f'{pin}_AUDIO'):
if config_c.get(f'{pin}_AUDIO') or config_c.get(f'{pin}_AUDIO_ALT'):
audio_pins.append(pin)
if audio_pins: