mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 12:13:34 +08:00
Merge remote-tracking branch 'upstream/master' into offboard2_externalsetpointmessages
This commit is contained in:
@@ -83,9 +83,12 @@ then
|
|||||||
param select $PARAM_FILE
|
param select $PARAM_FILE
|
||||||
if param load
|
if param load
|
||||||
then
|
then
|
||||||
echo "[init] Params loaded: $PARAM_FILE"
|
echo "[param] Loaded: $PARAM_FILE"
|
||||||
else
|
else
|
||||||
echo "[init] ERROR: Params loading failed: $PARAM_FILE"
|
echo "[param] FAILED loading $PARAM_FILE"
|
||||||
|
if param reset
|
||||||
|
then
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -280,9 +283,11 @@ then
|
|||||||
nshterm /dev/ttyACM0 &
|
nshterm /dev/ttyACM0 &
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start the datamanager
|
# Start the datamanager (and do not abort boot if it fails)
|
||||||
#
|
#
|
||||||
dataman start
|
if dataman start
|
||||||
|
then
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start the Commander (needs to be this early for in-air-restarts)
|
# Start the Commander (needs to be this early for in-air-restarts)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ class uploader(object):
|
|||||||
|
|
||||||
def __init__(self, portname, baudrate):
|
def __init__(self, portname, baudrate):
|
||||||
# open the port, keep the default timeout short so we can poll quickly
|
# open the port, keep the default timeout short so we can poll quickly
|
||||||
self.port = serial.Serial(portname, baudrate, timeout=0.5)
|
self.port = serial.Serial(portname, baudrate, timeout=2.0)
|
||||||
self.otp = b''
|
self.otp = b''
|
||||||
self.sn = b''
|
self.sn = b''
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual int init();
|
virtual int init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the PX4IO class.
|
||||||
|
*
|
||||||
|
* Retrieve relevant initial system parameters. Initialize PX4IO registers.
|
||||||
|
*
|
||||||
|
* @param disable_rc_handling set to true to forbid override / RC handling on IO
|
||||||
|
*/
|
||||||
|
int init(bool disable_rc_handling);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect if a PX4IO is connected.
|
* Detect if a PX4IO is connected.
|
||||||
*
|
*
|
||||||
@@ -579,6 +588,12 @@ PX4IO::detect()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
PX4IO::init(bool rc_handling_disabled) {
|
||||||
|
_rc_handling_disabled = rc_handling_disabled;
|
||||||
|
return init();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PX4IO::init()
|
PX4IO::init()
|
||||||
{
|
{
|
||||||
@@ -778,6 +793,11 @@ PX4IO::init()
|
|||||||
if (_rc_handling_disabled) {
|
if (_rc_handling_disabled) {
|
||||||
ret = io_disable_rc_handling();
|
ret = io_disable_rc_handling();
|
||||||
|
|
||||||
|
if (ret != OK) {
|
||||||
|
log("failed disabling RC handling");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* publish RC config to IO */
|
/* publish RC config to IO */
|
||||||
ret = io_set_rc_config();
|
ret = io_set_rc_config();
|
||||||
@@ -1175,6 +1195,7 @@ PX4IO::io_set_arming_state()
|
|||||||
int
|
int
|
||||||
PX4IO::disable_rc_handling()
|
PX4IO::disable_rc_handling()
|
||||||
{
|
{
|
||||||
|
_rc_handling_disabled = true;
|
||||||
return io_disable_rc_handling();
|
return io_disable_rc_handling();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2613,24 +2634,25 @@ start(int argc, char *argv[])
|
|||||||
errx(1, "driver alloc failed");
|
errx(1, "driver alloc failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OK != g_dev->init()) {
|
bool rc_handling_disabled = false;
|
||||||
delete g_dev;
|
|
||||||
g_dev = nullptr;
|
|
||||||
errx(1, "driver init failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* disable RC handling on request */
|
/* disable RC handling on request */
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (!strcmp(argv[1], "norc")) {
|
if (!strcmp(argv[1], "norc")) {
|
||||||
|
|
||||||
if (g_dev->disable_rc_handling())
|
rc_handling_disabled = true;
|
||||||
warnx("Failed disabling RC handling");
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("unknown argument: %s", argv[1]);
|
warnx("unknown argument: %s", argv[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OK != g_dev->init(rc_handling_disabled)) {
|
||||||
|
delete g_dev;
|
||||||
|
g_dev = nullptr;
|
||||||
|
errx(1, "driver init failed");
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
|
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
|
||||||
int dsm_vcc_ctl;
|
int dsm_vcc_ctl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user