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

Create and use AP_PERIPH_SERIAL_OPTIONS_ENABLED #29345

Merged
merged 2 commits into from
Feb 26, 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
2 changes: 1 addition & 1 deletion Tools/AP_Periph/AP_Periph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void AP_Periph_FW::init()
node_stats.init();
#endif

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED
serial_options.init();
#endif

Expand Down
2 changes: 1 addition & 1 deletion Tools/AP_Periph/AP_Periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class AP_Periph_FW {
BattBalance battery_balance;
#endif

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED
SerialOptions serial_options;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Tools/AP_Periph/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = {
GOBJECT(battery_balance, "BAL", BattBalance),
#endif

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED
// @Group: UART
// @Path: serial_options.cpp
GOBJECT(serial_options, "UART", SerialOptions),
Expand Down
4 changes: 2 additions & 2 deletions Tools/AP_Periph/serial_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "AP_Periph.h"

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED

#include "serial_options.h"
#include <AP_SerialManager/AP_SerialManager_config.h>
Expand Down Expand Up @@ -107,4 +107,4 @@ void SerialOptions::init(void)
}
}

#endif // HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#endif // AP_PERIPH_SERIAL_OPTIONS_ENABLED
4 changes: 2 additions & 2 deletions Tools/AP_Periph/serial_options.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED

#ifndef HAL_UART_NUM_SERIAL_PORTS
#define HAL_UART_NUM_SERIAL_PORTS AP_HAL::HAL::num_serial
Expand All @@ -27,4 +27,4 @@ class SerialOptions {
};


#endif // HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#endif // AP_PERIPH_SERIAL_OPTIONS_ENABLED
4 changes: 2 additions & 2 deletions Tools/AP_Periph/serial_options_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "AP_Periph.h"

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED

#include "serial_options.h"

Expand All @@ -44,4 +44,4 @@ const AP_Param::GroupInfo SerialOptionsDev::var_info[] {
AP_GROUPEND
};

#endif // HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#endif // AP_PERIPH_SERIAL_OPTIONS_ENABLED
4 changes: 3 additions & 1 deletion Tools/ardupilotwaf/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def configure_env(self, cfg, env):
AP_RPM_STREAM_ENABLED = 1,
AP_PERIPH_RC_OUT_ENABLED = 1,
AP_PERIPH_ADSB_ENABLED = 1,
HAL_PERIPH_ENABLE_SERIAL_OPTIONS = 1,
AP_PERIPH_SERIAL_OPTIONS_ENABLED = 1,
AP_AIRSPEED_ENABLED = 1,
AP_BATTERY_ESC_ENABLED = 1,
AP_PERIPH_MSP_ENABLED =0,
Expand All @@ -994,6 +994,7 @@ def configure_env(self, cfg, env):
APJ_BOARD_ID = 101,

AP_PERIPH_BATTERY_ENABLED = 0,
AP_PERIPH_SERIAL_OPTIONS_ENABLED = 0,
AP_PERIPH_ADSB_ENABLED = 0,
AP_PERIPH_GPS_ENABLED = 1,
AP_PERIPH_RELAY_ENABLED = 0,
Expand Down Expand Up @@ -1026,6 +1027,7 @@ def configure_env(self, cfg, env):
APJ_BOARD_ID = 101,

AP_PERIPH_BATTERY_ENABLED = 1,
AP_PERIPH_SERIAL_OPTIONS_ENABLED = 0,
AP_PERIPH_BATTERY_BALANCE_ENABLED = 0,
AP_PERIPH_RELAY_ENABLED = 0,
AP_PERIPH_ADSB_ENABLED = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env AP_PERIPH 1
define AP_CAN_SLCAN_ENABLED 0

define AP_PERIPH_NETWORKING_ENABLED 1
define HAL_PERIPH_ENABLE_SERIAL_OPTIONS
define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1

define AP_NETWORKING_BACKEND_PPP 1

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/MatekL431-Serial/hwdef.dat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../MatekL431/hwdef.inc

define HAL_PERIPH_ENABLE_SERIAL_OPTIONS
define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1

# enable serial3 port with DMA
undef PB10
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X-PPPGW/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env AP_PERIPH 1
define AP_CAN_SLCAN_ENABLED 0

define AP_PERIPH_NETWORKING_ENABLED 1
define HAL_PERIPH_ENABLE_SERIAL_OPTIONS
define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1

define AP_NETWORKING_BACKEND_PPP 1

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/include/network_PPPGW.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define AP_RC_CHANNEL_ENABLED 0

define AP_PERIPH_RTC_ENABLED 1

define HAL_PERIPH_ENABLE_SERIAL_OPTIONS
define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1
define AP_NETWORKING_BACKEND_PPP 1
define AP_NETWORKING_CAN_MCAST_ENABLED 1

Expand Down
8 changes: 7 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
#ifdef HAL_PERIPH_ENABLE_NOTIFY
#error "Change 'define HAL_PERIPH_ENABLE_NOTIFY' to 'define AP_PERIPH_NOTIFY_ENABLED 1'"
#endif
#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
#error "Change 'define HAL_PERIPH_ENABLE_SERIAL_OPTIONS' to 'define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1'"
#endif
#ifdef HAL_PERIPH_ENABLE_GPS
#error "Change 'define HAL_PERIPH_ENABLE_GPS' to 'define AP_PERIPH_GPS_ENABLED 1'"
#endif
Expand Down Expand Up @@ -233,6 +236,9 @@
#ifndef AP_PERIPH_NOTIFY_ENABLED
#define AP_PERIPH_NOTIFY_ENABLED 0
#endif
#ifndef AP_PERIPH_SERIAL_OPTIONS_ENABLED
#define AP_PERIPH_SERIAL_OPTIONS_ENABLED 0
#endif
#ifndef AP_PERIPH_BATTERY_ENABLED
#define AP_PERIPH_BATTERY_ENABLED 0
#endif
Expand Down Expand Up @@ -510,7 +516,7 @@
#endif

#ifndef AP_UART_MONITOR_ENABLED
#define AP_UART_MONITOR_ENABLED defined(HAL_PERIPH_ENABLE_SERIAL_OPTIONS) || (AP_PERIPH_GPS_ENABLED && (GPS_MOVING_BASELINE || BOARD_FLASH_SIZE>=256))
#define AP_UART_MONITOR_ENABLED AP_PERIPH_SERIAL_OPTIONS_ENABLED || (AP_PERIPH_GPS_ENABLED && (GPS_MOVING_BASELINE || BOARD_FLASH_SIZE>=256))
#endif

#ifndef HAL_BOARD_LOG_DIRECTORY
Expand Down
Loading