HAL_ChibiOS: fixed AP_FILESYSTEM_ROMFS_ENABLED for peripherals with defaults.parm

now that defaults are in ROMFS we must enable
AP_FILESYSTEM_ROMFS_ENABLED
This commit is contained in:
Andrew Tridgell 2024-08-02 18:58:16 +10:00
parent 7bdb8d770d
commit 9543eecf23
1 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class ChibiOSHWDef(object):
self.signed_fw = signed_fw self.signed_fw = signed_fw
self.default_params_filepath = default_params_filepath self.default_params_filepath = default_params_filepath
self.quiet = quiet self.quiet = quiet
self.have_defaults_file = False
# if true then parameters will be appended in special apj-tool # if true then parameters will be appended in special apj-tool
# section at end of binary: # section at end of binary:
@ -2644,6 +2645,13 @@ Please run: Tools/scripts/build_bootloaders.py %s
self.write_board_validate_macro(f) self.write_board_validate_macro(f)
self.write_check_firmware(f) self.write_check_firmware(f)
if self.have_defaults_file:
f.write('''
#ifndef AP_FILESYSTEM_ROMFS_ENABLED
#define AP_FILESYSTEM_ROMFS_ENABLED 1
#endif
''')
self.write_peripheral_enable(f) self.write_peripheral_enable(f)
if os.path.exists(self.processed_defaults_filepath()): if os.path.exists(self.processed_defaults_filepath()):
@ -3277,6 +3285,7 @@ Please run: Tools/scripts/build_bootloaders.py %s
return return
self.romfs_add('defaults.parm', filepath) self.romfs_add('defaults.parm', filepath)
self.have_defaults_file = True
def process_hwdefs(self): def process_hwdefs(self):
for fname in self.hwdef: for fname in self.hwdef: