mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 08:13:33 +08:00
Multiple stages for UAVCAN_ENABLE
This commit is contained in:
committed by
Lorenz Meier
parent
4296dac884
commit
6864779fa6
@@ -3,7 +3,26 @@
|
|||||||
# UAVCAN initialization script.
|
# UAVCAN initialization script.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Mirriring the UAVCAN_ENABLE param value to an eponymous environment variable.
|
||||||
|
# TODO there should be a smarter way.
|
||||||
|
#
|
||||||
|
set UAVCAN_ENABLE 0
|
||||||
if param compare UAVCAN_ENABLE 1
|
if param compare UAVCAN_ENABLE 1
|
||||||
|
then
|
||||||
|
set UAVCAN_ENABLE 1
|
||||||
|
fi
|
||||||
|
if param compare UAVCAN_ENABLE 2
|
||||||
|
then
|
||||||
|
set UAVCAN_ENABLE 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[i] UAVCAN_ENABLE is $UAVCAN_ENABLE"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Starting stuff according to UAVCAN_ENABLE value
|
||||||
|
#
|
||||||
|
if [ $UAVCAN_ENABLE -ge 1 ]
|
||||||
then
|
then
|
||||||
if uavcan start
|
if uavcan start
|
||||||
then
|
then
|
||||||
@@ -16,3 +35,14 @@ then
|
|||||||
tone_alarm $TUNE_ERR
|
tone_alarm $TUNE_ERR
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $UAVCAN_ENABLE -ge 2 ]
|
||||||
|
then
|
||||||
|
if uavcan start fw
|
||||||
|
then
|
||||||
|
echo "[i] UAVCAN servers started"
|
||||||
|
else
|
||||||
|
echo "[i] ERROR: Could not start UAVCAN servers"
|
||||||
|
tone_alarm $TUNE_ERR
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -41,10 +41,13 @@
|
|||||||
/**
|
/**
|
||||||
* Enable UAVCAN.
|
* Enable UAVCAN.
|
||||||
*
|
*
|
||||||
* Enables support for UAVCAN-interfaced actuators and sensors.
|
* Allowed values:
|
||||||
|
* 0 - UAVCAN disabled.
|
||||||
|
* 1 - Enabled support for UAVCAN actuators and sensors.
|
||||||
|
* 2 - Enabled support for dynamic node ID allocation and firmware update.
|
||||||
*
|
*
|
||||||
* @min 0
|
* @min 0
|
||||||
* @max 1
|
* @max 2
|
||||||
* @group UAVCAN
|
* @group UAVCAN
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(UAVCAN_ENABLE, 0);
|
PARAM_DEFINE_INT32(UAVCAN_ENABLE, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user