Skip to content

Commit

Permalink
allow display config from json
Browse files Browse the repository at this point in the history
dromer committed Dec 23, 2023
1 parent f77c6b4 commit be9b9dd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/json2daisy/json2daisy.py
Original file line number Diff line number Diff line change
@@ -193,12 +193,10 @@ 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]

0 comments on commit be9b9dd

Please sign in to comment.