From d0ac8f30169710c233d66e8bb81cd9fc0c2d90f7 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Wed, 3 May 2023 19:30:51 -0500 Subject: [PATCH] AP_HAL_ChibiOS: normalize SerialManagers ports defaults to allow inclusion in hwdefs --- libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp | 8 +++++--- .../hwdef/AtomRCF405NAVI/hwdef.dat | 4 ++-- libraries/AP_HAL_ChibiOS/hwdef/BeastF7/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/BeastF7v2/hwdef.dat | 4 ++-- libraries/AP_HAL_ChibiOS/hwdef/BeastH7/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/BeastH7v2/hwdef.dat | 4 ++-- .../AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat | 2 +- .../hwdef/CubeRedPrimary/hwdef.dat | 4 ++-- .../hwdef/CubeRedSecondary/hwdef.dat | 8 ++++---- .../AP_HAL_ChibiOS/hwdef/DevEBoxH7v2/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/DrotekP3Pro/hwdef.dat | 4 ++-- .../hwdef/FlywooF405S-AIO/hwdef.dat | 4 ++-- .../AP_HAL_ChibiOS/hwdef/FoxeerH743v1/hwdef.dat | 15 ++++++++++----- libraries/AP_HAL_ChibiOS/hwdef/HerePro/hwdef.dat | 2 +- .../hwdef/JHEMCU-GSF405A-RX2/hwdef.dat | 4 ++-- .../hwdef/JHEMCU-GSF405A/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/KakuteF4Mini/hwdef.dat | 8 ++++---- .../AP_HAL_ChibiOS/hwdef/KakuteF7Mini/hwdef.dat | 4 ++-- .../hwdef/KakuteH7-bdshot/hwdef.dat | 8 ++++---- .../AP_HAL_ChibiOS/hwdef/KakuteH7Mini/hwdef.dat | 8 ++++---- .../AP_HAL_ChibiOS/hwdef/MambaH743v4/hwdef.dat | 8 ++++---- .../AP_HAL_ChibiOS/hwdef/Pixracer/hwdef.dat | 4 ++-- .../hwdef/QioTekZealotF427/hwdef.dat | 4 ++-- .../AP_HAL_ChibiOS/hwdef/ReaperF745/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/SPRacingH7/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat | 3 ++- .../AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat | 3 ++- .../AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat | 2 +- .../hwdef/SkystarsH7HD-bdshot/hwdef.dat | 10 +++++----- .../AP_HAL_ChibiOS/hwdef/SkystarsH7HD/hwdef.dat | 4 ++-- .../hwdef/SpeedyBeeF405WING/hwdef.dat | 2 +- .../AP_HAL_ChibiOS/hwdef/luminousbee4/hwdef.dat | 4 ++-- .../AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat | 4 ++-- .../AP_HAL_ChibiOS/hwdef/modalai_fc-v1/hwdef.dat | 4 ++-- .../hwdef/scripts/chibios_hwdef.py | 12 ++++++------ .../AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat | 16 ++++++++-------- 39 files changed, 99 insertions(+), 90 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp index 45f4b3ba00..2becb68aa4 100644 --- a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp +++ b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp @@ -38,8 +38,10 @@ #include -#ifndef HAL_SERIAL0_BAUD_DEFAULT -#define HAL_SERIAL0_BAUD_DEFAULT 115200 +#ifndef DEFAULT_SERIAL0_BAUD +#define SERIAL0_BAUD 115200 +#else +#define SERIAL0_BAUD DEFAULT_SERIAL0_BAUD #endif #ifndef HAL_NO_UARTDRIVER @@ -223,7 +225,7 @@ static void main_loop() peripheral_power_enable(); - hal.serial(0)->begin(HAL_SERIAL0_BAUD_DEFAULT); + hal.serial(0)->begin(SERIAL0_BAUD); #ifdef HAL_SPI_CHECK_CLOCK_FREQ // optional test of SPI clock frequencies diff --git a/libraries/AP_HAL_ChibiOS/hwdef/AtomRCF405NAVI/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/AtomRCF405NAVI/hwdef.dat index be2dc4b5cc..5f6a023e8f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/AtomRCF405NAVI/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/AtomRCF405NAVI/hwdef.dat @@ -86,12 +86,12 @@ PA3 USART2_RX USART2 NODMA ALT(1) # USART3 PC10 USART3_TX USART3 PC11 USART3_RX USART3 -define HAL_SERIAL3_PROTOCOL 0 +define DEFAULT_SERIAL3_PROTOCOL 0 # UART4 GPS PA0 UART4_TX UART4 NODMA PA1 UART4_RX UART4 NODMA -define HAL_SERIAL4_PROTOCOL 5 +define DEFAULT_SERIAL4_PROTOCOL 5 # UART5 for DJI OSD PD2 UART5_RX UART5 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BeastF7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BeastF7/hwdef.dat index fc4657dd92..496e7563d1 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BeastF7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BeastF7/hwdef.dat @@ -81,7 +81,7 @@ PA3 USART2_RX USART2 NODMA # USART3 (DJI RCIN) PB11 USART3_RX USART3 -define HAL_SERIAL3_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_RCIN # UART4 PA0 UART4_TX UART4 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BeastF7v2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BeastF7v2/hwdef.dat index 2d70af75fd..174747369a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BeastF7v2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BeastF7v2/hwdef.dat @@ -4,7 +4,7 @@ include ../BeastF7/hwdef.dat undef APJ_BOARD_ID -undef HAL_SERIAL3_PROTOCOL +undef DEFAULT_SERIAL3_PROTOCOL undef IMU undef BARO undef PD15 @@ -36,7 +36,7 @@ PA9 USART1_TX USART1 NODMA # USART2 (DJI RCIN) PA3 USART2_RX USART2 PA2 USART2_TX USART2 NODMA -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN # USART3 (RCIN) PB11 USART3_RX USART3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BeastH7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BeastH7/hwdef.dat index cdad68b72e..34fc186a44 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BeastH7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BeastH7/hwdef.dat @@ -82,7 +82,7 @@ PA3 USART2_RX USART2 # USART3 (DJI RCIN) PB11 USART3_RX USART3 -define HAL_SERIAL3_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_RCIN # UART4 PA0 UART4_TX UART4 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BeastH7v2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BeastH7v2/hwdef.dat index 798a76ccbf..be1ca4f118 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BeastH7v2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BeastH7v2/hwdef.dat @@ -4,7 +4,7 @@ include ../BeastH7/hwdef.dat undef APJ_BOARD_ID -undef HAL_SERIAL3_PROTOCOL +undef DEFAULT_SERIAL3_PROTOCOL undef IMU undef BARO undef PD15 @@ -36,7 +36,7 @@ PA9 USART1_TX USART1 NODMA # USART2 (DJI RCIN) PA3 USART2_RX USART2 PA2 USART2_TX USART2 NODMA -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN # USART3 (RCIN) PB11 USART3_RX USART3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat index 4348ab6a3b..6fca9fdc6f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat @@ -45,7 +45,7 @@ PB5 TIM3_CH2 TIM3 PWM(4) GPIO(53) # USART1 for debug # PA15 USART1_TX USART1 # PB3 USART1_RX USART1 -# define HAL_SERIAL0_BAUD_DEFAULT 57600 +# define DEFAULT_SERIAL0_BAUD 57600 # ------ end RCOUT pins ------ diff --git a/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat index f0e1fc6a5d..52a9c8de09 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat @@ -42,7 +42,7 @@ PB0 LED OUTPUT LOW # USART1 for debug PB6 USART1_TX USART1 NODMA PB7 USART1_RX USART1 NODMA -define HAL_SERIAL0_BAUD_DEFAULT 57600 +define DEFAULT_SERIAL0_BAUD 57600 # USART2 for GPS PA2 USART2_TX USART2 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat index 66d4acf272..67d70da010 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat @@ -41,7 +41,7 @@ PB12 LED OUTPUT LOW # USART1 for debug PB6 USART1_TX USART1 NODMA PB7 USART1_RX USART1 NODMA -define HAL_SERIAL0_BAUD_DEFAULT 57600 +define DEFAULT_SERIAL0_BAUD 57600 # USART2 for GPS PA2 USART2_TX USART2 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat index e2c175a99b..3cccc06deb 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat @@ -272,5 +272,5 @@ INT_FLASH_PRIMARY 1 # forward Serial traffic from USB OTG2 to Serial7(UART7) define HAL_FORWARD_OTG2_SERIAL 7 define HAL_HAVE_DUAL_USB_CDC 1 -define HAL_SERIAL7_PROTOCOL SerialProtocol_MAVLink2 -define HAL_SERIAL7_BAUD 2000000 +define DEFAULT_SERIAL7_PROTOCOL SerialProtocol_MAVLink2 +define DEFAULT_SERIAL7_BAUD 2000000 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat index 49ecf6ca91..e44d3e1fe0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat @@ -146,10 +146,10 @@ PD3 USART2_CTS USART2 SPEED_HIGH SERIAL_ORDER UART7 UART8 USART3 USART6 UART4 USART2 # use 2 MBaud when talking to primary controller -define HAL_SERIAL0_BAUD_DEFAULT 2000000 -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL3_PROTOCOL SerialProtocol_Sbus1 -define HAL_SERIAL4_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL0_BAUD 2000000 +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_Sbus1 +define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_RCIN # only use pulse input for PPM, other protocols diff --git a/libraries/AP_HAL_ChibiOS/hwdef/DevEBoxH7v2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/DevEBoxH7v2/hwdef.dat index 2129cbe22a..ebf649a80b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/DevEBoxH7v2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/DevEBoxH7v2/hwdef.dat @@ -75,7 +75,7 @@ PB14 USART1_TX USART1 # USART2 (RCIN) PD5 USART2_TX USART2 PD6 USART2_RX USART2 ALT(1) -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN # USART3 PD9 USART3_RX USART3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/DrotekP3Pro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/DrotekP3Pro/hwdef.dat index a83e641fc4..a70259e0e9 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/DrotekP3Pro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/DrotekP3Pro/hwdef.dat @@ -239,8 +239,8 @@ define HAL_BATT_VOLT_SCALE 10.1 define HAL_BATT_CURR_SCALE 17.0 # setup serial port defaults for ESP8266 -define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 -define HAL_SERIAL5_BAUD 921600 +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 +define DEFAULT_SERIAL5_BAUD 921600 # We can't share the IO UART (USART6). DMA_NOSHARE USART6_TX USART6_RX ADC1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat index 8deb4f27cd..3e3e4885a2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat @@ -54,12 +54,12 @@ PA12 OTG_FS_DP OTG1 # USART1 (ELRS) PA10 USART1_RX USART1 PB6 USART1_TX USART1 -define HAL_SERIAL1_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN # USART2 (GPS) PD5 USART2_TX USART2 NODMA PD6 USART2_RX USART2 -define HAL_SERIAL2_PROTOCOL SerialProtocol_GPS +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_GPS # USART3 (RX) PB10 USART3_TX USART3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FoxeerH743v1/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FoxeerH743v1/hwdef.dat index 8a39ca9c0e..93cb9a299d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FoxeerH743v1/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FoxeerH743v1/hwdef.dat @@ -59,21 +59,25 @@ PA12 OTG_FS_DP OTG1 # USART1 (RX/SBUS) PA10 USART1_RX USART1 PA9 USART1_TX USART1 +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN + # USART2 (VTX) PA2 USART2_TX USART2 NODMA PA3 USART2_RX USART2 NODMA -define HAL_SERIAL2_PROTOCOL SerialProtocol_Tramp +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_Tramp + # USART3 PB10 USART3_TX USART3 PB11 USART3_RX USART3 -define HAL_SERIAL3_PROTOCOL SerialProtocol_None +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_None + # UART4 (DJI RX/SBUS) PA0 UART4_TX UART4 NODMA PA1 UART4_RX UART4 -define HAL_SERIAL4_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_RCIN # USART6 (GPS) PC6 USART6_TX USART6 @@ -81,6 +85,7 @@ PC7 USART6_RX USART6 define HAL_SERIAL6_PROTOCOL SerialProtocol_GPS define HAL_SERIAL6_BAUD 115 + # UART7 (DJI OSD) PE7 UART7_RX UART7 PE8 UART7_TX UART7 @@ -90,8 +95,8 @@ define HAL_SERIAL7_BAUD 115 # UART8 (ESC) PE0 UART8_RX UART8 NODMA PE1 UART8_TX UART8 NODMA -define HAL_SERIAL8_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL8_BAUD 115 +define DEFAULT_SERIAL8_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL8_BAUD 115 # I2C ports I2C_ORDER I2C1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HerePro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HerePro/hwdef.dat index 764dc0389b..977a1be132 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/HerePro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/HerePro/hwdef.dat @@ -34,7 +34,7 @@ STM32_VDD 330U # order of UARTs (and USB) SERIAL_ORDER OTG1 OTG2 EMPTY USART3 UART7 -define HAL_SERIAL0_PROTOCOL SerialProtocol_None +define DEFAULT_SERIAL0_PROTOCOL SerialProtocol_None # USART3 F9 PD9 USART3_RX USART3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat index 513d3fd294..f4b81633c8 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat @@ -8,13 +8,13 @@ include ../JHEMCU-GSF405A/hwdef.dat undef PD5 PD6 PB10 PB11 PA3 PA2 -undef HAL_SERIAL1_PROTOCOL +undef DEFAULT_SERIAL1_PROTOCOL # USART2 - SBUS pad PD5 USART2_TX USART2 PD6 USART2_RX USART2 # default Serial2 to RCIN -define HAL_SERIAL2_PROTOCOL 23 +define DEFAULT_SERIAL2_PROTOCOL 23 # USART3 PB10 USART3_TX USART3 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat index 53a126f955..9a5766c43e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat @@ -37,7 +37,7 @@ PA8 VBUS INPUT OPENDRAIN PB6 USART1_TX USART1 PA10 USART1_RX USART1 # default Serial1 to ELRS RX -define HAL_SERIAL1_PROTOCOL 23 +define DEFAULT_SERIAL1_PROTOCOL 23 define HAL_RSSI_TYPE 3 # USART2 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat index 0e097ea4e1..a434ff5a21 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat @@ -83,7 +83,7 @@ PA9 USART1_TX USART1 PA10 USART1_RX USART1 # default Serial2 to FrSky telemetry -define HAL_SERIAL2_PROTOCOL 10 +define DEFAULT_SERIAL2_PROTOCOL 10 # USART6, telem1, SERIAL1 PC6 USART6_TX USART6 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4Mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4Mini/hwdef.dat index 9911b41e77..6a16d98855 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4Mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4Mini/hwdef.dat @@ -8,7 +8,7 @@ undef PB0 PB1 PA3 PA2 PB11 PB10 PD2 PC8 undef SERIAL_ORDER undef CH_CFG_ST_RESOLUTION undef STM32_ST_USE_TIMER -undef HAL_SERIAL2_PROTOCOL +undef DEFAULT_SERIAL2_PROTOCOL APJ_BOARD_ID 1030 @@ -20,9 +20,9 @@ SERIAL_ORDER OTG1 USART1 EMPTY USART3 UART4 UART5 USART6 PB11 USART3_RX USART3 PB10 USART3_TX USART3 -define HAL_SERIAL3_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL5_BAUD 115 +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL5_BAUD 115 # UART5 (ESC telemetry sensor), SERIAL5, NODMA for bi-dir dshot PD2 UART5_RX UART5 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7Mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7Mini/hwdef.dat index 50c5267040..b75699ac4c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7Mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7Mini/hwdef.dat @@ -94,8 +94,8 @@ PA1 UART4_RX UART4 NODMA # RC input defaults to UART to allow for bi-dir dshot PC6 USART6_TX USART6 PC7 USART6_RX USART6 -define HAL_SERIAL6_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL6_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL6_BAUD 115 # UART7, RX only for ESC Telemetry # No DMA because SPI2 requires the DMA slot diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7-bdshot/hwdef.dat index 3d116c20b6..06adca621d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7-bdshot/hwdef.dat @@ -7,10 +7,10 @@ undef PB0 PB1 PB3 PB10 PC7 # Must use USART6 for RCIN rather than RCINT as timer needed for bi-dir dshot PC7 USART6_RX USART6 NODMA -define HAL_SERIAL6_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL6_BAUD 115 -define HAL_SERIAL7_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL7_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL6_BAUD 115 +define DEFAULT_SERIAL7_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL7_BAUD 115 PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) BIDIR PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7Mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7Mini/hwdef.dat index d50bf17743..58405b8711 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7Mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7Mini/hwdef.dat @@ -111,10 +111,10 @@ PC6 USART6_TX USART6 # UART7 used by ESC, TX is not connected PE7 UART7_RX UART7 NODMA -define HAL_SERIAL6_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL6_BAUD 115 -define HAL_SERIAL7_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL7_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL6_BAUD 115 +define DEFAULT_SERIAL7_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL7_BAUD 115 # Motors PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) BIDIR diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MambaH743v4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MambaH743v4/hwdef.dat index 6c7dc69208..3f0d57058d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MambaH743v4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MambaH743v4/hwdef.dat @@ -129,10 +129,10 @@ PE7 UART7_RX UART7 PE1 UART8_TX UART8 NODMA PE0 UART8_RX UART8 NODMA -define HAL_SERIAL1_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL1_BAUD 115 -define HAL_SERIAL6_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL6_BAUD 115 +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL1_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL6_BAUD 115 # Motors PA0 TIM5_CH1 TIM5 PWM(1) GPIO(50) BIDIR diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixracer/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixracer/hwdef.dat index ad8ec0aba6..6db2b9ee9e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixracer/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixracer/hwdef.dat @@ -207,8 +207,8 @@ define HAL_BATT_VOLT_SCALE 10.1 define HAL_BATT_CURR_SCALE 17.0 # setup serial port defaults for ESP8266 -define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 -define HAL_SERIAL5_BAUD 921600 +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 +define DEFAULT_SERIAL5_BAUD 921600 # two IMUs IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotF427/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotF427/hwdef.dat index cc5358dd18..e88eb4469b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotF427/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotF427/hwdef.dat @@ -50,8 +50,8 @@ PB7 USART1_RX USART1 PD5 USART2_TX USART2 NODMA PD6 USART2_RX USART2 -define HAL_SERIAL2_PROTOCOL SerialProtocol_MAVLink2 -define HAL_SERIAL2_BAUD 921600 +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_MAVLink2 +define DEFAULT_SERIAL2_BAUD 921600 # USART3 for gps1 PD8 USART3_TX USART3 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/ReaperF745/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/ReaperF745/hwdef.dat index 97857bebc0..a862e1142d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/ReaperF745/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/ReaperF745/hwdef.dat @@ -83,7 +83,7 @@ PA10 USART1_RX USART1 NODMA # USART2 (RX) PA2 USART2_TX USART2 PA3 USART2_RX USART2 -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN # USART3 PB10 USART3_TX USART3 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SPRacingH7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SPRacingH7/hwdef.dat index 2e10631cf7..dcf04ba13a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SPRacingH7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SPRacingH7/hwdef.dat @@ -93,7 +93,7 @@ define HAL_BATT_MONITOR_DEFAULT 4 # USART1 (RCIN) PB15 USART1_RX USART1 PB14 USART1_TX USART1 -define HAL_SERIAL1_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN # USART2 (SmartPort) PD5 USART2_TX USART2 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat index 5f0dfbb6ca..4492d3d061 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat @@ -75,7 +75,7 @@ SERIAL_ORDER USART1 EMPTY EMPTY USART2 # USART1 for debug PA9 USART1_TX USART1 PA10 USART1_RX USART1 -define HAL_SERIAL0_BAUD_DEFAULT 57600 +define DEFAULT_SERIAL0_BAUD 57600 # USART2 M9N PA2 USART2_TX USART2 SPEED_HIGH @@ -130,3 +130,4 @@ PC7 M9SB INPUT define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0 define DEFAULT_NTF_LED_TYPES 455 + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat index 41848ff4f0..729070cb71 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat @@ -40,7 +40,7 @@ SERIAL_ORDER USART1 EMPTY EMPTY USART2 # USART1 for debug PA9 USART1_TX USART1 PA10 USART1_RX USART1 -define HAL_SERIAL0_BAUD_DEFAULT 57600 +define DEFAULT_SERIAL0_BAUD 57600 # Enable the sensor voltage pin PC13 VDD_3V3_SENSORS_EN OUTPUT HIGH @@ -133,3 +133,4 @@ PC8 GPS_PPS_IN INPUT PC7 M9SB INPUT define DEFAULT_NTF_LED_TYPES 455 + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat index 2f390a868c..63b247a505 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat @@ -40,7 +40,7 @@ SERIAL_ORDER USART1 EMPTY EMPTY USART2 # USART1 for debug PA9 USART1_TX USART1 NODMA PA10 USART1_RX USART1 NODMA -define HAL_SERIAL0_BAUD_DEFAULT 57600 +define DEFAULT_SERIAL0_BAUD 57600 # USART2 for GPS PA2 USART2_TX USART2 SPEED_HIGH diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD-bdshot/hwdef.dat index 2171618b93..aef033bcab 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD-bdshot/hwdef.dat @@ -5,7 +5,7 @@ include ../SkystarsH7HD/hwdef.dat undef PB0 PB1 PD12 PA0 PA2 PC7 PC6 PD8 PD9 PB5 PB6 PE0 PE1 undef HAL_I2C_INTERNAL_MASK DMA_PRIORITY DMA_NOSHARE -undef HAL_SERIAL6_PROTOCOL HAL_SERIAL6_BAUD +undef DEFAULT_SERIAL6_PROTOCOL DEFAULT_SERIAL6_BAUD MCU_CLOCKRATE_MHZ 480 @@ -21,8 +21,8 @@ define RELAY3_PIN_DEFAULT 82 # PIN-EN define HAL_FRAME_TYPE_DEFAULT 12 # USART1 (RX) -define HAL_SERIAL1_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL1_BAUD 115 +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL1_BAUD 115 # USART3 (ESC Telem) PD8 USART3_TX USART3 NODMA PD9 USART3_RX USART3 NODMA @@ -31,8 +31,8 @@ PD9 USART3_RX USART3 NODMA PB5 UART5_RX UART5 NODMA PB6 UART5_TX UART5 NODMA # USART6 (DJI FPV) -define HAL_SERIAL6_PROTOCOL SerialProtocol_DJI_FPV -define HAL_SERIAL6_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_DJI_FPV +define DEFAULT_SERIAL6_BAUD 115 # UART7 # UART8 PE0 UART8_RX UART8 NODMA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD/hwdef.dat index b5bf33b1f5..150169fd89 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SkystarsH7HD/hwdef.dat @@ -156,8 +156,8 @@ PE8 UART7_TX UART7 PE0 UART8_RX UART8 PE1 UART8_TX UART8 -define HAL_SERIAL6_PROTOCOL SerialProtocol_RCIN -define HAL_SERIAL6_BAUD 115 +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL6_BAUD 115 # Motors PB0 TIM1_CH2N TIM1 PWM(1) GPIO(50) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING/hwdef.dat index 6dfffe79ba..6aa5b0e7ef 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING/hwdef.dat @@ -108,7 +108,7 @@ PD2 UART5_RX UART5 NODMA # UART6 (onboard Telemetry) PC6 USART6_TX USART6 PC7 USART6_RX USART6 -define HAL_SERIAL6_BAUD 115 +define DEFAULT_SERIAL6_BAUD 115 # USB PA11 OTG_FS_DM OTG1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee4/hwdef.dat index 5b74c56d09..1b0a62c2d6 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee4/hwdef.dat @@ -169,8 +169,8 @@ define HAL_BATT_VOLT_SCALE 10.1 define HAL_BATT_CURR_SCALE 17.0 # setup serial port defaults for ESP8266 -define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 -define HAL_SERIAL5_BAUD 921600 +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_MAVLink2 +define DEFAULT_SERIAL5_BAUD 921600 # Set one or two IMUs #IMU Invensense SPI:icm20608 ROTATION_YAW_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat index 8a1d468d8a..836dd20448 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat @@ -206,8 +206,8 @@ define HAL_BATT_VOLT_SCALE 10.1 define HAL_BATT_CURR_SCALE 17.0 # setup serial port defaults for ESP8266 -define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink -define HAL_SERIAL5_BAUD 921600 +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_MAVLink +define DEFAULT_SERIAL5_BAUD 921600 # two IMUs #IMU Invensense SPI:icm20608 ROTATION_YAW_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/modalai_fc-v1/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/modalai_fc-v1/hwdef.dat index b92662d14d..4d7c0bd129 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/modalai_fc-v1/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/modalai_fc-v1/hwdef.dat @@ -174,8 +174,8 @@ define HAL_SPEKTRUM_PWR_ENABLED 1 # setup for RCIN on USUART6, will auto-baud for 100000 and 115200 and # auto-switch inversion as needed -define HAL_SERIAL6_PROTOCOL 23 -define HAL_SERIAL6_BAUD 115200 +define DEFAULT_SERIAL6_PROTOCOL 23 +define DEFAULT_SERIAL6_BAUD 115200 # UART7 Telem 1, TELEM_UART_4W PE7 UART7_RX UART7 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index f16c30f877..e9b347ed07 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1913,8 +1913,8 @@ INCLUDE common.ld #ifndef HAL_OTG2_PROTOCOL #define HAL_OTG2_PROTOCOL SerialProtocol_SLCAN #endif -#define HAL_SERIAL%d_PROTOCOL HAL_OTG2_PROTOCOL -#define HAL_SERIAL%d_BAUD 115200 +#define DEFAULT_SERIAL%d_PROTOCOL HAL_OTG2_PROTOCOL +#define DEFAULT_SERIAL%d_BAUD 115200 #endif ''' % (OTG2_index, OTG2_index)) @@ -3000,10 +3000,10 @@ INCLUDE common.ld #endif // default to no protocols, AP_Periph enables with params -#define HAL_SERIAL1_PROTOCOL -1 -#define HAL_SERIAL2_PROTOCOL -1 -#define HAL_SERIAL3_PROTOCOL -1 -#define HAL_SERIAL4_PROTOCOL -1 +#define DEFAULT_SERIAL1_PROTOCOL -1 +#define DEFAULT_SERIAL2_PROTOCOL -1 +#define DEFAULT_SERIAL3_PROTOCOL -1 +#define DEFAULT_SERIAL4_PROTOCOL -1 #ifndef HAL_LOGGING_MAVLINK_ENABLED #define HAL_LOGGING_MAVLINK_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat index 87a70e4365..12c43673a0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat @@ -67,34 +67,34 @@ define BOARD_RSSI_ANA_PIN 12 # USART1 (DJI / VTX) PA9 USART1_TX USART1 PA10 USART1_RX USART1 -define HAL_SERIAL1_PROTOCOL SerialProtocol_DJI_FPV +define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_DJI_FPV # USART2 (RCIN) PA2 USART2_TX USART2 PA3 USART2_RX USART2 -define HAL_SERIAL2_PROTOCOL SerialProtocol_RCIN +define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN # USART3 (CAM) PC10 USART3_TX USART3 NODMA PC11 USART3_RX USART3 NODMA -define HAL_SERIAL3_PROTOCOL SerialProtocol_None +define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_None # UART4 (Bluetooth) PA0 UART4_TX UART4 NODMA PA1 UART4_RX UART4 NODMA -define HAL_SERIAL4_PROTOCOL SerialProtocol_None +define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_None # UART5 (ESC Telemetry) PC12 UART5_TX UART5 NODMA PD2 UART5_RX UART5 NODMA -define HAL_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry -define HAL_SERIAL5_BAUD 19200 +define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry +define DEFAULT_SERIAL5_BAUD 19200 # UART6 (GPS) PC6 USART6_TX USART6 PC7 USART6_RX USART6 -define HAL_SERIAL6_PROTOCOL SerialProtocol_GPS -define HAL_SERIAL6_BAUD AP_SERIALMANAGER_GPS_BAUD +define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_GPS +define DEFAULT_SERIAL6_BAUD AP_SERIALMANAGER_GPS_BAUD # PA10 IO-debug-console PA11 OTG_FS_DM OTG1