Fix path separators on windows
This commit is contained in:
parent
61bca5a789
commit
ce95fe0ac5
@ -502,6 +502,7 @@ def parse_chips():
|
|||||||
chip_groups = []
|
chip_groups = []
|
||||||
|
|
||||||
for f in sorted(glob('sources/cubedb/mcu/STM32*.xml')):
|
for f in sorted(glob('sources/cubedb/mcu/STM32*.xml')):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
if 'STM32MP' in f:
|
if 'STM32MP' in f:
|
||||||
continue
|
continue
|
||||||
if 'STM32GBK' in f:
|
if 'STM32GBK' in f:
|
||||||
@ -879,6 +880,7 @@ def remove_duplicates(item_list):
|
|||||||
def parse_gpio_af():
|
def parse_gpio_af():
|
||||||
# os.makedirs('data/gpio_af', exist_ok=True)
|
# os.makedirs('data/gpio_af', exist_ok=True)
|
||||||
for f in glob('sources/cubedb/mcu/IP/GPIO-*_gpio_v1_0_Modes.xml'):
|
for f in glob('sources/cubedb/mcu/IP/GPIO-*_gpio_v1_0_Modes.xml'):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
|
|
||||||
ff = removeprefix(f, 'sources/cubedb/mcu/IP/GPIO-')
|
ff = removeprefix(f, 'sources/cubedb/mcu/IP/GPIO-')
|
||||||
ff = removesuffix(ff, '_gpio_v1_0_Modes.xml')
|
ff = removesuffix(ff, '_gpio_v1_0_Modes.xml')
|
||||||
@ -963,6 +965,7 @@ dma_channels = {}
|
|||||||
|
|
||||||
def parse_dma():
|
def parse_dma():
|
||||||
for f in glob('sources/cubedb/mcu/IP/*DMA-*Modes.xml'):
|
for f in glob('sources/cubedb/mcu/IP/*DMA-*Modes.xml'):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
is_explicitly_bdma = False
|
is_explicitly_bdma = False
|
||||||
ff = removeprefix(f, 'sources/cubedb/mcu/IP/')
|
ff = removeprefix(f, 'sources/cubedb/mcu/IP/')
|
||||||
if not (ff.startswith('B') or ff.startswith('D')):
|
if not (ff.startswith('B') or ff.startswith('D')):
|
||||||
@ -994,6 +997,7 @@ def parse_dma():
|
|||||||
if ff.startswith('STM32L4S'):
|
if ff.startswith('STM32L4S'):
|
||||||
dmamux_file = 'L4RS'
|
dmamux_file = 'L4RS'
|
||||||
for mf in sorted(glob('data/dmamux/{}_*.yaml'.format(dmamux_file))):
|
for mf in sorted(glob('data/dmamux/{}_*.yaml'.format(dmamux_file))):
|
||||||
|
mf = mf.replace(os.path.sep, '/')
|
||||||
with open(mf, 'r') as yaml_file:
|
with open(mf, 'r') as yaml_file:
|
||||||
y = yaml.load(yaml_file)
|
y = yaml.load(yaml_file)
|
||||||
mf = removesuffix(mf, '.yaml')
|
mf = removesuffix(mf, '.yaml')
|
||||||
@ -1110,6 +1114,7 @@ peripheral_to_clock = {}
|
|||||||
def parse_rcc_regs():
|
def parse_rcc_regs():
|
||||||
print("parsing RCC registers")
|
print("parsing RCC registers")
|
||||||
for f in glob('data/registers/rcc_*'):
|
for f in glob('data/registers/rcc_*'):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
ff = removeprefix(f, 'data/registers/rcc_')
|
ff = removeprefix(f, 'data/registers/rcc_')
|
||||||
ff = removesuffix(ff, '.yaml')
|
ff = removesuffix(ff, '.yaml')
|
||||||
family_clocks = {}
|
family_clocks = {}
|
||||||
@ -1160,6 +1165,7 @@ chip_interrupts = {}
|
|||||||
def parse_interrupts():
|
def parse_interrupts():
|
||||||
print("parsing interrupts")
|
print("parsing interrupts")
|
||||||
for f in glob('sources/cubedb/mcu/IP/NVIC*_Modes.xml'):
|
for f in glob('sources/cubedb/mcu/IP/NVIC*_Modes.xml'):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
ff = removeprefix(f, 'sources/cubedb/mcu/IP/NVIC')
|
ff = removeprefix(f, 'sources/cubedb/mcu/IP/NVIC')
|
||||||
ff = removesuffix(ff, '_Modes.xml')
|
ff = removesuffix(ff, '_Modes.xml')
|
||||||
|
|
||||||
|
@ -189,6 +189,7 @@ def parse_headers():
|
|||||||
os.makedirs('sources/headers_parsed', exist_ok=True)
|
os.makedirs('sources/headers_parsed', exist_ok=True)
|
||||||
print('loading headers...')
|
print('loading headers...')
|
||||||
for f in glob('sources/headers/*.h'):
|
for f in glob('sources/headers/*.h'):
|
||||||
|
f = f.replace(os.path.sep, '/')
|
||||||
# if 'stm32f4' not in f: continue
|
# if 'stm32f4' not in f: continue
|
||||||
ff = removeprefix(f, 'sources/headers/')
|
ff = removeprefix(f, 'sources/headers/')
|
||||||
ff = removesuffix(ff, '.h')
|
ff = removesuffix(ff, '.h')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user