diff --git a/src/json2daisy/json2daisy.py b/src/json2daisy/json2daisy.py index 131eb04..0504b71 100644 --- a/src/json2daisy/json2daisy.py +++ b/src/json2daisy/json2daisy.py @@ -193,17 +193,17 @@ def generate_header(board_description_dict: dict) -> 'tuple[str, dict]': target['aliases'] = {} if 'display' in target: - # apply defaults - target['display'] = { - 'driver': "daisy::SSD130x4WireSpi128x64Driver", - 'config': [], - 'dim': [128, 64] - } + # apply defaults if not present in config + target['display']['driver'] = target['display'].get('driver', "daisy::SSD130x4WireSpi128x64Driver") + target['display']['config'] = target['display'].get('config', []) + target['display']['dim'] = target['display'].get('dim', [128, 64]) target['defines']['OOPSY_TARGET_HAS_OLED'] = 1 target['defines']['OOPSY_OLED_DISPLAY_WIDTH'] = target['display']['dim'][0] target['defines']['OOPSY_OLED_DISPLAY_HEIGHT'] = target['display']['dim'][1] + target['displayprocess'] = target['display'].get('process', '') + replacements = {} replacements['name'] = target['name'] replacements['som'] = som @@ -322,7 +322,8 @@ def generate_header(board_description_dict: dict) -> 'tuple[str, dict]': 'components': components, 'aliases': target['aliases'], 'channels': audio_channels, - 'has_midi': target.get('has_midi', False) + 'has_midi': target.get('has_midi', False), + 'displayprocess': target.get('displayprocess', '') } return rendered_header, board_info