HAL_ChibiOS: use ifndef on more peripheral types

This commit is contained in:
Andrew Tridgell 2019-02-13 18:44:28 +11:00
parent 6fb40a9713
commit d6bedc3bdf
1 changed files with 6 additions and 2 deletions

View File

@ -840,7 +840,7 @@ def write_UART_config(f):
if not need_uart_driver and not args.bootloader:
f.write('''
#ifndef HAL_USE_SERIAL
#define HAL_USE_SERIAL FALSE
#define HAL_USE_SERIAL HAL_USE_SERIAL_USB
#endif
''')
@ -933,7 +933,11 @@ def write_PWM_config(f):
if not pwm_out:
print("No PWM output defined")
f.write('#define HAL_USE_PWM FALSE\n')
f.write('''
#ifndef HAL_USE_PWM
#define HAL_USE_PWM FALSE
#endif
''')
if rc_in is not None:
(n, chan, compl) = parse_timer(rc_in.label)