Skip to content

Commit

Permalink
HAL_ChibiOS: fixed AP_FILESYSTEM_ROMFS_ENABLED for peripherals with d…
Browse files Browse the repository at this point in the history
…efaults.parm

now that defaults are in ROMFS we must enable
AP_FILESYSTEM_ROMFS_ENABLED
  • Loading branch information
tridge committed Aug 4, 2024
1 parent 7bdb8d7 commit 9543eec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, quiet=False, bootloader=False, signed_fw=False, outdir=None,
self.signed_fw = signed_fw
self.default_params_filepath = default_params_filepath
self.quiet = quiet
self.have_defaults_file = False

# if true then parameters will be appended in special apj-tool
# section at end of binary:
Expand Down Expand Up @@ -2644,6 +2645,13 @@ def write_hwdef_header(self, outfilename):
self.write_board_validate_macro(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)

if os.path.exists(self.processed_defaults_filepath()):
Expand Down Expand Up @@ -3277,6 +3285,7 @@ def write_default_parameters(self):
return

self.romfs_add('defaults.parm', filepath)
self.have_defaults_file = True

def process_hwdefs(self):
for fname in self.hwdef:
Expand Down

0 comments on commit 9543eec

Please sign in to comment.