mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 12:13:35 +08:00
[mavlink] Parameter to always start on USB (#22234)
* usb: Added parameter to enable always starting mavlink on USB.
Refactored cdcacm_init into a module and added a paramter to allow always starting mavlink on
USB, also added a paramter to choose the mode. The current default behavior is to wait and listen
for data on USB and auto-detect the protocol (mavlink, nsh, ublox). This results in the mavlink
stream not starting until something else on the mavlink network sends a packet first. The new
default behavior is to always start mavlink.
Added parameters
MAV_USB_ENABLE -- default 1 (always start mavlink on USB)
MAV_USE_MODE -- default 3 (onboard)
* added 3 retries for opening serial port in mavlink, removed sleep before sercon
* added DRIVERS_CDCACM_AUTOSTART to ark-v6x default.px4board
* added CONFIG_DRIVERS_CDCACM_AUTOSTART=y to default.px4board for boards with CONFIG_CDCACM in their nsh/defconfig
* format
* remove PGA460 from COMMON_DISTANCE_SENSOR to save flash
* remove LIS2MDL from COMMON_MAGNETOMETER to save flash
* disable CONFIG_DRIVERS_CDCACM_AUTOSTART for fmu-v5 protected.px4board
* moved and renamed parameters, removed mode logic in mavlink
* changed parameter names, added mode none
* remove parameters from mavlink
This commit is contained in:
@@ -38,7 +38,6 @@ if(NOT PX4_BOARD MATCHES "io-v2")
|
||||
board_crashdump.c
|
||||
board_dma_alloc.c
|
||||
board_fat_dma_alloc.c
|
||||
cdc_acm_check.cpp
|
||||
console_buffer.cpp
|
||||
cpuload.cpp
|
||||
gpio.c
|
||||
|
||||
@@ -62,8 +62,6 @@
|
||||
#include <px4_platform/board_ctrl.h>
|
||||
#endif
|
||||
|
||||
extern void cdcacm_init(void);
|
||||
|
||||
#if !defined(CONFIG_BUILD_FLAT)
|
||||
typedef CODE void (*initializer_t)(void);
|
||||
extern initializer_t _sinit;
|
||||
@@ -196,10 +194,6 @@ int px4_platform_init()
|
||||
|
||||
px4_log_initialize();
|
||||
|
||||
#if defined(CONFIG_SYSTEM_CDCACM) && defined(CONFIG_BUILD_FLAT)
|
||||
cdcacm_init();
|
||||
#endif
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
add_library(px4_layer
|
||||
${KERNEL_SRCS}
|
||||
cdc_acm_check.cpp
|
||||
${PX4_SOURCE_DIR}/platforms/common/Serial.cpp
|
||||
SerialImpl.cpp
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ add_library(px4_layer
|
||||
board_fat_dma_alloc.c
|
||||
tasks.cpp
|
||||
console_buffer_usr.cpp
|
||||
cdc_acm_check.cpp
|
||||
${PX4_SOURCE_DIR}/platforms/posix/src/px4/common/print_load.cpp
|
||||
${PX4_SOURCE_DIR}/platforms/posix/src/px4/common/cpuload.cpp
|
||||
px4_userspace_init.cpp
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#include <uORB/uORB.h>
|
||||
#include <sys/boardctl.h>
|
||||
|
||||
extern void cdcacm_init(void);
|
||||
|
||||
extern "C" void px4_userspace_init(void)
|
||||
{
|
||||
hrt_init();
|
||||
@@ -55,8 +53,4 @@ extern "C" void px4_userspace_init(void)
|
||||
px4::WorkQueueManagerStart();
|
||||
|
||||
uorb_start();
|
||||
|
||||
#if defined(CONFIG_SYSTEM_CDCACM)
|
||||
cdcacm_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user