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

Remove more un-needed lines from hwdef.dat files #26677

Merged
merged 4 commits into from
Apr 3, 2024
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
6 changes: 5 additions & 1 deletion libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#define SERIAL0_BAUD DEFAULT_SERIAL0_BAUD
#endif

#ifndef HAL_SCHEDULER_LOOP_DELAY_ENABLED
#define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1
#endif

#ifndef HAL_NO_UARTDRIVER
static HAL_SERIAL0_DRIVER;
static HAL_SERIAL1_DRIVER;
Expand Down Expand Up @@ -296,6 +300,7 @@ static void main_loop()
while (true) {
g_callbacks->loop();

#if HAL_SCHEDULER_LOOP_DELAY_ENABLED && !APM_BUILD_TYPE(APM_BUILD_Replay)
/*
give up 50 microseconds of time if the INS loop hasn't
called delay_microseconds_boost(), to ensure low priority
Expand All @@ -304,7 +309,6 @@ static void main_loop()
time from the main loop, so we don't need to do it again
here
*/
#if !defined(HAL_DISABLE_LOOP_DELAY) && !APM_BUILD_TYPE(APM_BUILD_Replay)
if (!schedulerInstance.check_called_boost()) {
hal.scheduler->delay_microseconds(50);
}
Expand Down
8 changes: 6 additions & 2 deletions libraries/AP_HAL_ChibiOS/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ extern AP_IOMCU iomcu;

using namespace ChibiOS;

#ifndef HAL_RCIN_THREAD_ENABLED
#define HAL_RCIN_THREAD_ENABLED 1
#endif

extern const AP_HAL::HAL& hal;
#ifndef HAL_NO_TIMER_THREAD
THD_WORKING_AREA(_timer_thread_wa, TIMER_THD_WA_SIZE);
#endif
#ifndef HAL_NO_RCOUT_THREAD
THD_WORKING_AREA(_rcout_thread_wa, RCOUT_THD_WA_SIZE);
#endif
#ifndef HAL_NO_RCIN_THREAD
#if HAL_RCIN_THREAD_ENABLED
THD_WORKING_AREA(_rcin_thread_wa, RCIN_THD_WA_SIZE);
#endif
#ifndef HAL_USE_EMPTY_IO
Expand Down Expand Up @@ -122,7 +126,7 @@ void Scheduler::init()
this); /* Thread parameter. */
#endif

#ifndef HAL_NO_RCIN_THREAD
#if HAL_RCIN_THREAD_ENABLED
// setup the RCIN thread - this will call tasks at 1kHz
_rcin_thread_ctx = chThdCreateStatic(_rcin_thread_wa,
sizeof(_rcin_thread_wa),
Expand Down
3 changes: 1 addition & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/AR-F407SmartBat/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ PC13 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW HIGH

CAN_ORDER 1

define HAL_DISABLE_LOOP_DELAY

define HAL_NO_MONITOR_THREAD

# debugger support
Expand Down Expand Up @@ -60,3 +58,4 @@ define AP_PERIPH_BATTERY_BALANCE_RATE_DEFAULT 2
define AP_PERIPH_BATTERY_BALANCE_CELL1_PIN_DEFAULT 1
define AP_PERIPH_BATTERY_BALANCE_ID_DEFAULT 0

define HAL_RCIN_THREAD_ENABLED 1
3 changes: 3 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_CANNODE/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ define AP_SERIALLED_ENABLED 1
define HAL_PERIPH_ENABLE_RANGEFINDER
# disable rangefinder by default
define AP_PERIPH_RANGEFINDER_PORT_DEFAULT -1

define HAL_RCIN_THREAD_ENABLED 1
define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD

define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PA11 CAN1_RX CAN1
PA12 CAN1_TX CAN1
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,5 @@ define HAL_PERIPH_GPS_PORT_DEFAULT 1


define HAL_SERIAL_ESC_COMM_ENABLED 1
define HAL_RCIN_THREAD_ENABLED 1
define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD

define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PA11 CAN1_RX CAN1
PA12 CAN1_TX CAN1
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ define HAL_PERIPH_ENABLE_RC_OUT
define HAL_PERIPH_GPS_PORT_DEFAULT 1

define HAL_SERIAL_ESC_COMM_ENABLED 1
define HAL_RCIN_THREAD_ENABLED 1
define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ define DMA_RESERVE_SIZE 0
MAIN_STACK 0x800
PROCESS_STACK 0x800

define HAL_DISABLE_LOOP_DELAY
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

Expand Down
2 changes: 0 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/AeroFox-GNSS_F9P/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ MAIN_STACK 0x300

# PROCESS_STACK controls stack for main thread
PROCESS_STACK 0xA00
define HAL_DISABLE_LOOP_DELAY
define HAL_NO_MONITOR_THREAD

# we setup a small defaults.parm
Expand Down Expand Up @@ -94,7 +93,6 @@ define HAL_USE_ADC FALSE

# disable unnecessary threads
define HAL_NO_MONITOR_THREAD
define HAL_NO_RCIN_THREAD
define HAL_NO_TIMER_THREAD

# enable LED
Expand Down
3 changes: 1 addition & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/AeroFox-PMU/hwdef-bl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ define DMA_RESERVE_SIZE 0
MAIN_STACK 0x800
PROCESS_STACK 0x800

define HAL_DISABLE_LOOP_DELAY
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
PA14 JTCK-SWCLK SWD
1 change: 1 addition & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/AeroFox-PMU/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ define HAL_GPIO_B_LED_PIN 1
define HAL_GPIO_C_LED_PIN 2

define HAL_SERIAL_ESC_COMM_ENABLED 1
define HAL_RCIN_THREAD_ENABLED 1
2 changes: 0 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/AeroFox-PMU/hwdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ MAIN_STACK 0x300
# PROCESS_STACK controls stack for main thread
PROCESS_STACK 0xA00

define HAL_DISABLE_LOOP_DELAY

define HAL_NO_MONITOR_THREAD

# setup a small defaults.parm
Expand Down
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,10 @@ define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD


define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
6 changes: 0 additions & 6 deletions libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,10 @@ define HAL_DISABLE_ADC_DRIVER TRUE

define HAL_NO_GPIO_IRQ

# avoid RCIN thread to save memory
define HAL_NO_RCIN_THREAD

define HAL_USE_RTC FALSE

define DMA_RESERVE_SIZE 0


define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/BotBloxSwitch/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ define STM32_ADC_USE_ADC1 FALSE
define STM32_ADC_USE_ADC2 FALSE
define STM32_ADC_USE_ADC3 FALSE

define HAL_RCIN_THREAD_ENABLED 1
define HAL_SCHEDULER_LOOP_DELAY_ENABLED 1
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD

define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,10 @@ define HAL_DISABLE_ADC_DRIVER TRUE
define HAL_NO_GPIO_IRQ

# avoid RCIN thread to save memory
define HAL_NO_RCIN_THREAD
define HAL_USE_RTC FALSE

define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ define STM32_SERIAL_USE_USART3 FALSE
define HAL_NO_GPIO_IRQ
define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
# avoid timer thread to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD


define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
6 changes: 0 additions & 6 deletions libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,10 @@ define HAL_DISABLE_ADC_DRIVER TRUE

define HAL_NO_GPIO_IRQ

# avoid RCIN thread to save memory
define HAL_NO_RCIN_THREAD

define HAL_USE_RTC FALSE

define DMA_RESERVE_SIZE 0


define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
2 changes: 0 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ define DMA_RESERVE_SIZE 0
MAIN_STACK 0x800
PROCESS_STACK 0x800

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ MAIN_STACK 0x300
# PROCESS_STACK controls stack for main thread
PROCESS_STACK 0xA00

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down Expand Up @@ -141,6 +139,4 @@ COMPASS MMC5XX3 I2C:0:0x30 false ROTATION_NONE
define AP_COMPASS_QMC5883P_ENABLED 1
COMPASS QMC5883P I2C:0:0x2C false ROTATION_YAW_180




define HAL_RCIN_THREAD_ENABLED 1
2 changes: 0 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ define DMA_RESERVE_SIZE 0
MAIN_STACK 0x800
PROCESS_STACK 0x800

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ MAIN_STACK 0x300
# PROCESS_STACK controls stack for main thread
PROCESS_STACK 0xA00

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down Expand Up @@ -142,3 +140,5 @@ BARO MS56XX I2C:0:0x76
COMPASS QMC5883P I2C:0:0x2C false ROTATION_YAW_180

define AP_COMPASS_QMC5883P_ENABLED 1

define HAL_RCIN_THREAD_ENABLED 1
4 changes: 0 additions & 4 deletions libraries/AP_HAL_ChibiOS/hwdef/CubeBlack-periph/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ define HAL_COMPASS_MAX_SENSORS 1

define HAL_NO_MONITOR_THREAD

define HAL_DISABLE_LOOP_DELAY

define HAL_USE_RTC FALSE

define HAL_NO_RCIN_THREAD

define HAL_BARO_ALLOW_INIT_NO_BARO

define HAL_PERIPH_ENABLE_BATTERY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ define HAL_COMPASS_MAX_SENSORS 1

define HAL_NO_MONITOR_THREAD

define HAL_DISABLE_LOOP_DELAY

define HAL_USE_RTC FALSE

define HAL_GCS_ENABLED 1

define HAL_NO_RCIN_THREAD

define HAL_BARO_ALLOW_INIT_NO_BARO


Expand Down
4 changes: 0 additions & 4 deletions libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ define HAL_COMPASS_MAX_SENSORS 1

define HAL_NO_MONITOR_THREAD

define HAL_DISABLE_LOOP_DELAY

define HAL_USE_RTC FALSE

define HAL_NO_RCIN_THREAD

define HAL_BARO_ALLOW_INIT_NO_BARO


Expand Down
9 changes: 0 additions & 9 deletions libraries/AP_HAL_ChibiOS/hwdef/CubePilot-CANMod/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ MCU STM32H7xx STM32H757xx
define CORE_CM7
define SMPS_PWR

define HAL_BUILD_AP_PERIPH

# board ID for firmware load
APJ_BOARD_ID 1079

Expand Down Expand Up @@ -72,13 +70,6 @@ define BOARD_PHY_ID MII_LAN8720_ID
define BOARD_PHY_RMII
define HAL_PERIPH_ENABLE_NETWORKING

# ---------------------------------------------------------------------------------------------
# AP_Periph - boiler-plate configurations that all HW AP-Periph need
# ---------------------------------------------------------------------------------------------
define HAL_NO_RCIN_THREAD
#define HAL_NO_GPIO_IRQ
define HAL_DISABLE_LOOP_DELAY

#################################
# AP_Periph - configurations specific to this App
#################################
Expand Down
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary-PPPGW/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ define HAL_PERIPH_ENABLE_SERIAL_OPTIONS
define AP_NETWORKING_BACKEND_PPP 1

define HAL_NO_MONITOR_THREAD
define HAL_DISABLE_LOOP_DELAY

define HAL_USE_RTC FALSE

define HAL_NO_RCIN_THREAD

# use amber LED
define HAL_GPIO_PIN_LED HAL_GPIO_PIN_FMU_LED_AMBER

Expand Down
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/FreeflyRTK/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,9 @@ define HAL_USE_EMPTY_IO TRUE

# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD

define DMA_RESERVE_SIZE 0

define HAL_DISABLE_LOOP_DELAY

# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
Expand Down
Loading
Loading