HAL_ChibiOS: include hwdef.dat in ROMFS
this allows download via ftp
This commit is contained in:
parent
c1d4a5bd35
commit
e0957c2bcc
@ -97,6 +97,8 @@ imu_list = []
|
|||||||
compass_list = []
|
compass_list = []
|
||||||
baro_list = []
|
baro_list = []
|
||||||
|
|
||||||
|
all_lines = []
|
||||||
|
|
||||||
mcu_type = None
|
mcu_type = None
|
||||||
dual_USB_enabled = False
|
dual_USB_enabled = False
|
||||||
|
|
||||||
@ -1586,6 +1588,13 @@ def write_alt_config(f):
|
|||||||
f.write(" { %u, %s, PAL_LINE(GPIO%s,%uU)}, /* %s */ \\\n" % (alt, p.pal_modeline(), p.port, p.pin, str(p)))
|
f.write(" { %u, %s, PAL_LINE(GPIO%s,%uU)}, /* %s */ \\\n" % (alt, p.pal_modeline(), p.port, p.pin, str(p)))
|
||||||
f.write('}\n\n')
|
f.write('}\n\n')
|
||||||
|
|
||||||
|
def write_all_lines(hwdat):
|
||||||
|
f = open(hwdat, 'w')
|
||||||
|
f.write('\n'.join(all_lines))
|
||||||
|
f.close()
|
||||||
|
flash_size = get_config('FLASH_SIZE_KB', type=int)
|
||||||
|
if flash_size > 1024:
|
||||||
|
romfs["hwdef.dat"] = hwdat
|
||||||
|
|
||||||
def write_hwdef_header(outfilename):
|
def write_hwdef_header(outfilename):
|
||||||
'''write hwdef header file'''
|
'''write hwdef header file'''
|
||||||
@ -1833,6 +1842,7 @@ def process_line(line):
|
|||||||
'''process one line of pin definition file'''
|
'''process one line of pin definition file'''
|
||||||
global allpins, imu_list, compass_list, baro_list
|
global allpins, imu_list, compass_list, baro_list
|
||||||
global mcu_type, mcu_series
|
global mcu_type, mcu_series
|
||||||
|
all_lines.append(line)
|
||||||
a = shlex.split(line)
|
a = shlex.split(line)
|
||||||
# keep all config lines for later use
|
# keep all config lines for later use
|
||||||
alllines.append(line)
|
alllines.append(line)
|
||||||
@ -1973,6 +1983,9 @@ print("Setup for MCU %s" % mcu_type)
|
|||||||
# build a list for peripherals for DMA resolver
|
# build a list for peripherals for DMA resolver
|
||||||
periph_list = build_peripheral_list()
|
periph_list = build_peripheral_list()
|
||||||
|
|
||||||
|
# write out hw.dat for ROMFS
|
||||||
|
write_all_lines(os.path.join(outdir, "hw.dat"))
|
||||||
|
|
||||||
# write out hwdef.h
|
# write out hwdef.h
|
||||||
write_hwdef_header(os.path.join(outdir, "hwdef.h"))
|
write_hwdef_header(os.path.join(outdir, "hwdef.h"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user