Skip to content

Commit

Permalink
AP_HAL_ChibiOS: allow IOMCU to be turned off in includes
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Mar 17, 2024
1 parent 40dd813 commit 7ea2928
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ def write_UART_config(self, f):
if 'io_firmware.bin' not in self.romfs:
self.error("Need io_firmware.bin in ROMFS for IOMCU")

f.write('#define HAL_WITH_IO_MCU 1\n')
self.write_defaulting_define(f, 'HAL_WITH_IO_MCU', 1)
f.write('#define HAL_UART_IOMCU_IDX %u\n' % len(serial_list))
f.write(
'#define HAL_UART_IO_DRIVER ChibiOS::UARTDriver uart_io(HAL_UART_IOMCU_IDX)\n'
Expand Down Expand Up @@ -2525,6 +2525,11 @@ def write_all_lines(self, hwdat):
if not self.is_periph_fw():
self.romfs["hwdef.dat"] = hwdat

def write_defaulting_define(self, f, name, value):
f.write(f"#ifndef {name}\n")
f.write(f"#define {name} {value}\n")
f.write("#endif\n")

def write_define(self, f, name, value):
f.write(f"#define {name} {value}\n")

Expand Down

0 comments on commit 7ea2928

Please sign in to comment.