diff --git a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp index c221b482b0..e621d7fc58 100644 --- a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp +++ b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp @@ -48,7 +48,7 @@ #define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1 #endif -#ifndef HAL_NO_UARTDRIVER +#if AP_HAL_UARTDRIVER_ENABLED static HAL_SERIAL0_DRIVER; static HAL_SERIAL1_DRIVER; static HAL_SERIAL2_DRIVER; diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp index 4bc97e1414..035444cbee 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp @@ -18,7 +18,7 @@ #define HAL_FORWARD_OTG2_SERIAL_LOCK_KEY 0x23565283UL -#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS && !defined(HAL_NO_UARTDRIVER) +#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS && AP_HAL_UARTDRIVER_ENABLED #include #include "UARTDriver.h" diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Hitec-Airspeed/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Hitec-Airspeed/hwdef.dat index 02e4dc43f3..b9e7df2f27 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Hitec-Airspeed/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Hitec-Airspeed/hwdef.dat @@ -29,7 +29,7 @@ FLASH_SIZE_KB 128 # SERIAL_ORDER USART1 SERIAL_ORDER define HAL_USE_UART FALSE -define HAL_NO_UARTDRIVER TRUE +define AP_HAL_UARTDRIVER_ENABLED 0 define HAL_CAN_POOL_SIZE 6000 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.inc b/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.inc index 8387878750..eb1854f5e0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.inc @@ -117,7 +117,7 @@ define __FPU_PRESENT 0 define HAL_USE_RTC FALSE define HAL_NO_FLASH_SUPPORT TRUE -define HAL_NO_UARTDRIVER TRUE +define AP_HAL_UARTDRIVER_ENABLED 0 define HAL_LOGGING_ENABLED 0 define DMA_RESERVE_SIZE 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 935db8536f..211e4443c7 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1221,7 +1221,6 @@ class ChibiOSHWDef(object): #define HAL_BOOTLOADER_BUILD TRUE #define HAL_USE_ADC FALSE #define HAL_USE_EXT FALSE -#define HAL_NO_UARTDRIVER #define HAL_NO_PRINTF #define HAL_NO_CCM #define HAL_USE_I2C FALSE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_bootloader.h b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_bootloader.h index 205a200230..91f9de9ae3 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_bootloader.h +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_bootloader.h @@ -10,6 +10,11 @@ #define HAL_GYROFFT_ENABLED 0 #endif +// bootloaders use serial directly: +#ifndef AP_HAL_UARTDRIVER_ENABLED +#define AP_HAL_UARTDRIVER_ENABLED 0 +#endif + // bootloaders don't talk to the GCS: #ifndef HAL_GCS_ENABLED #define HAL_GCS_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat index 18e17fe682..b525c809fd 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat @@ -51,7 +51,7 @@ PA15 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW # disable serial define HAL_USE_SERIAL FALSE -define HAL_NO_UARTDRIVER TRUE +define AP_HAL_UARTDRIVER_ENABLED 0 define HAL_USE_ADC FALSE