Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename HAL_NO_UARTDRIVER -> AP_HAL_UARTDRIVER_ENABLED #29019

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libraries/AP_HAL/AP_HAL_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
#define HAL_WITH_DSP HAL_GYROFFT_ENABLED
#endif

#ifndef AP_HAL_UARTDRIVER_ENABLED
#define AP_HAL_UARTDRIVER_ENABLED 1
#endif

#ifndef HAL_OS_FATFS_IO
#define HAL_OS_FATFS_IO 0
#endif
Expand Down
3 changes: 0 additions & 3 deletions libraries/AP_HAL/DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#include <AP_Math/AP_Math.h>
#include "AP_HAL.h"
#include "DSP.h"
#ifndef HAL_NO_UARTDRIVER
#include <GCS_MAVLink/GCS.h>
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#include <assert.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL/UARTDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <AP_Logger/AP_Logger_config.h>

#ifndef HAL_UART_STATS_ENABLED
#define HAL_UART_STATS_ENABLED !defined(HAL_NO_UARTDRIVER)
#define HAL_UART_STATS_ENABLED AP_HAL_UARTDRIVER_ENABLED
#endif

#ifndef AP_UART_MONITOR_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/UARTDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hal.h>
#include "UARTDriver.h"
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/Hitec-Airspeed/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,6 @@ def write_mcu_config(self, f):
#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
Expand Down
5 changes: 5 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_bootloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading