Fix peripheral names with underscores
This commit is contained in:
parent
ce95fe0ac5
commit
8e1a07b928
@ -662,9 +662,14 @@ def parse_chips():
|
|||||||
signal = 'SUBGHZSPI_' + signal[16:-3]
|
signal = 'SUBGHZSPI_' + signal[16:-3]
|
||||||
# TODO: What are those signals (well, GPIO is clear) Which peripheral do they belong to?
|
# TODO: What are those signals (well, GPIO is clear) Which peripheral do they belong to?
|
||||||
if signal not in {'GPIO', 'CEC', 'AUDIOCLK', 'VDDTCXO'} and 'EXTI' not in signal:
|
if signal not in {'GPIO', 'CEC', 'AUDIOCLK', 'VDDTCXO'} and 'EXTI' not in signal:
|
||||||
periph, signal = signal.split('_', maxsplit=1)
|
# both peripherals and signals can have underscores in their names so there is no easy way to split
|
||||||
pins = periph_pins.setdefault(periph, [])
|
# check if signal name starts with one of the peripheral names
|
||||||
pins.append(OrderedDict(pin=pin_name, signal=signal))
|
for periph in peri_kinds.keys():
|
||||||
|
if signal.startswith(periph + '_'):
|
||||||
|
signal = removeprefix(signal, periph + '_')
|
||||||
|
pins = periph_pins.setdefault(periph, [])
|
||||||
|
pins.append(OrderedDict(pin=pin_name, signal=signal))
|
||||||
|
break
|
||||||
for periph, pins in periph_pins.items():
|
for periph, pins in periph_pins.items():
|
||||||
pins = remove_duplicates(pins)
|
pins = remove_duplicates(pins)
|
||||||
sort_pins(pins)
|
sort_pins(pins)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user