diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 49f65919cd..274ad4b09b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1794,6 +1794,7 @@ def write_hwdef_header(outfilename): write_MAG_config(f) write_BARO_config(f) write_board_validate_macro(f) + add_apperiph_defaults(f) write_peripheral_enable(f) @@ -2150,6 +2151,18 @@ def process_file(filename): else: process_line(line) +def add_apperiph_defaults(f): + '''add default defines for peripherals''' + if env_vars.get('AP_PERIPH',0) == 0: + # not AP_Periph + return + print("Setting up as AP_Periph") + f.write(''' +#ifndef HAL_LOGGING_ENABLED +#define HAL_LOGGING_ENABLED 0 +#endif +''') + # process input file process_file(args.hwdef)