From 47a20f0dd28bae60c69455cefd9751d9e59a224b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 28 Oct 2015 22:55:37 +0100 Subject: [PATCH] Allow any system to become UAVCAN controlled by setting UAVCAN_ENABLE to 3. --- ROMFS/px4fmu_common/init.d/rcS | 8 ++++++++ src/modules/uavcan/uavcan_params.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 45128dae52..c4b25987be 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -391,6 +391,14 @@ then # set TTYS1_BUSY no + # + # Check if UAVCAN is enabled, default to it for ESCs + # + if param greater UAVCAN_ENABLE 2 + then + set OUTPUT_MODE uavcan_esc + fi + # If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output if [ $OUTPUT_MODE != none ] then diff --git a/src/modules/uavcan/uavcan_params.c b/src/modules/uavcan/uavcan_params.c index 3a49bd3eb7..5b20f11bf7 100644 --- a/src/modules/uavcan/uavcan_params.c +++ b/src/modules/uavcan/uavcan_params.c @@ -45,9 +45,10 @@ * 0 - UAVCAN disabled. * 1 - Enabled support for UAVCAN actuators and sensors. * 2 - Enabled support for dynamic node ID allocation and firmware update. + * 3 - Sets the motor control outputs to UAVCAN and enables support for dynamic node ID allocation and firmware update. * * @min 0 - * @max 2 + * @max 3 * @group UAVCAN */ PARAM_DEFINE_INT32(UAVCAN_ENABLE, 0);