diff --git a/src/json2daisy/json2daisy.py b/src/json2daisy/json2daisy.py index 5195c90..6866f6a 100644 --- a/src/json2daisy/json2daisy.py +++ b/src/json2daisy/json2daisy.py @@ -255,6 +255,7 @@ def generate_header(board_description_dict: dict) -> 'tuple[str, dict]': if 'defines' in target: if target['defines'].get('OOPSY_TARGET_HAS_MIDI_INPUT'): + target['has_midi'] = True replacements['midi'] = """daisy::MidiUartHandler midi; daisy::MidiUsbHandler midiusb;""" @@ -321,7 +322,8 @@ def generate_header(board_description_dict: dict) -> 'tuple[str, dict]': 'name': target['name'], 'components': components, 'aliases': target['aliases'], - 'channels': audio_channels + 'channels': audio_channels, + 'has_midi': target.get('has_midi', False) } return rendered_header, board_info