Skip to content

Commit

Permalink
Remove SYS_USE_IO param
Browse files Browse the repository at this point in the history
The param is not really required anymore with the actuator
configuration. Also, when it is set to 0, RC doesn't work for some
boards which would be nice to avoid.

Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes committed Nov 9, 2023
1 parent 1463f9d commit 19b681c
Show file tree
Hide file tree
Showing 22 changed files with 17 additions and 83 deletions.
35 changes: 15 additions & 20 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -274,32 +274,26 @@ else
. $FCONFIG
fi

#
# Start IO for PWM output or RC input if enabled
#
if param compare -s SYS_USE_IO 1
# Check if PX4IO present and update firmware if needed.
if [ -f $IOFW ]
then
# Check if PX4IO present and update firmware if needed.
if [ -f $IOFW ]
if ! px4io checkcrc ${IOFW}
then
if ! px4io checkcrc ${IOFW}
then
# tune Program PX4IO
tune_control play -t 16 # tune 16 = PROG_PX4IO
# tune Program PX4IO
tune_control play -t 16 # tune 16 = PROG_PX4IO

if px4io update ${IOFW}
if px4io update ${IOFW}
then
usleep 10000
tune_control stop
if px4io checkcrc ${IOFW}
then
usleep 10000
tune_control stop
if px4io checkcrc ${IOFW}
then
tune_control play -t 17 # tune 17 = PROG_PX4IO_OK
else
tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR
fi
tune_control play -t 17 # tune 17 = PROG_PX4IO_OK
else
tune_control stop
tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR
fi
else
tune_control stop
fi
fi

Expand All @@ -310,6 +304,7 @@ else
fi
fi


#
# RC update (map raw RC input to calibrate manual control)
# start before commander
Expand Down
7 changes: 0 additions & 7 deletions boards/ark/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,4 @@ then
param set-default SENS_TEMP_ID 3014666
fi

if ver hwtypecmp ARKV6X001000 ARKV6X001001 ARKV6X001002 ARKV6X001003 ARKV6X001004 ARKV6X001005 ARKV6X001006 ARKV6X001007
then
param set-default SYS_USE_IO 0
else
param set-default SYS_USE_IO 1
fi

safety_button start
2 changes: 0 additions & 2 deletions boards/cubepilot/cubeorange/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ param set-default SENS_EN_THERMAL 0

param set-default -s SENS_TEMP_ID 2621474

param set-default SYS_USE_IO 1

set IOFW "/etc/extras/cubepilot_io-v2_default.bin"
2 changes: 0 additions & 2 deletions boards/cubepilot/cubeorangeplus/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ param set-default SENS_EN_THERMAL 0

param set-default -s SENS_TEMP_ID 2621474

param set-default SYS_USE_IO 1

set IOFW "/etc/extras/cubepilot_io-v2_default.bin"
2 changes: 0 additions & 2 deletions boards/cubepilot/cubeyellow/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ param set-default BAT2_A_PER_V 17
# Disable IMU thermal control
param set-default SENS_EN_THERMAL 0

param set-default SYS_USE_IO 1

set IOFW "/etc/extras/cubepilot_io-v2_default.bin"
2 changes: 0 additions & 2 deletions boards/holybro/durandal-v1/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ param set-default BAT2_A_PER_V 36.367515152

# Enable IMU thermal control
param set-default SENS_EN_THERMAL 1

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/holybro/pix32v5/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ param set-default BAT2_V_DIV 18.1
param set-default BAT1_A_PER_V 36.367515152
param set-default BAT2_A_PER_V 36.367515152

param set-default SYS_USE_IO 1

rgbled_pwm start
safety_button start
2 changes: 0 additions & 2 deletions boards/mro/x21-777/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 10.177939394
param set-default BAT1_A_PER_V 15.391030303

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/mro/x21/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 10.177939394
param set-default BAT1_A_PER_V 15.391030303

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/px4/fmu-v2/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 10.177939394
param set-default BAT1_A_PER_V 15.391030303

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/px4/fmu-v3/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 10.177939394
param set-default BAT1_A_PER_V 15.391030303

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/px4/fmu-v4pro/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ param set-default BAT2_A_PER_V 26.4
param set-default EKF2_MULTI_IMU 2
param set-default SENS_IMU_MODE 0

param set-default SYS_USE_IO 1

set LOGGER_BUF 64
7 changes: 0 additions & 7 deletions boards/px4/fmu-v5/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ param set-default BAT2_V_DIV 18.1
param set-default BAT1_A_PER_V 36.367515152
param set-default BAT2_A_PER_V 36.367515152

if ver hwtypecmp V5004000 V5006000
then
param set-default SYS_USE_IO 0
else
param set-default SYS_USE_IO 1
fi

if ver hwtypecmp V5005000 V5005002 V5006000 V5006002
then
# CUAV V5+ (V550/V552) and V5nano (V560/V562) have 3 IMUs
Expand Down
2 changes: 0 additions & 2 deletions boards/px4/fmu-v5x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ param set-default SENS_EN_INA238 0
param set-default SENS_EN_INA228 0
param set-default SENS_EN_INA226 1

param set-default SYS_USE_IO 1

if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001
then
# Skynode: use the "custom participant" config for uxrce_dds_client
Expand Down
2 changes: 0 additions & 2 deletions boards/px4/fmu-v6c/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ param set-default BAT2_V_DIV 18.1

param set-default BAT1_A_PER_V 36.367515152
param set-default BAT2_A_PER_V 36.367515152

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/px4/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ param set-default SENS_EN_INA238 0
param set-default SENS_EN_INA228 0
param set-default SENS_EN_INA226 1

param set-default SYS_USE_IO 1

if ver hwtypecmp V6X009010 V6X010010
then
# Skynode: use the "custom participant" config for uxrce_dds_client
Expand Down
2 changes: 0 additions & 2 deletions boards/siyi/n7/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ param set-default BAT1_A_PER_V 36.367515152

# Enable IMU thermal control
param set-default SENS_EN_THERMAL 1

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/sky-drones/smartap-airlink/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ param set-default BAT_V_OFFS_CURR 0.413
# Disable safety switch
param set-default CBRK_IO_SAFETY 22027

param set-default SYS_USE_IO 1

safety_button start

set LOGGER_BUF 32
2 changes: 0 additions & 2 deletions boards/thepeach/k1/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 18.1
param set-default BAT1_A_PER_V 36.367515152

param set-default SYS_USE_IO 1
2 changes: 0 additions & 2 deletions boards/thepeach/r1/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

param set-default BAT1_V_DIV 18.1
param set-default BAT1_A_PER_V 36.367515152

param set-default SYS_USE_IO 1
5 changes: 2 additions & 3 deletions src/drivers/px4io/px4io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ class PX4IO : public cdev::CDev, public ModuleBase<PX4IO>, public OutputModuleIn
(ParamInt<px4::params::RC_RSSI_PWM_MAX>) _param_rc_rssi_pwm_max,
(ParamInt<px4::params::RC_RSSI_PWM_MIN>) _param_rc_rssi_pwm_min,
(ParamInt<px4::params::SENS_EN_THERMAL>) _param_sens_en_themal,
(ParamInt<px4::params::SYS_HITL>) _param_sys_hitl,
(ParamInt<px4::params::SYS_USE_IO>) _param_sys_use_io
(ParamInt<px4::params::SYS_HITL>) _param_sys_hitl
)
};

Expand Down Expand Up @@ -468,7 +467,7 @@ int PX4IO::init()
}

/* try to claim the generic PWM output device node as well - it's OK if we fail at this */
if (_param_sys_hitl.get() <= 0 && _param_sys_use_io.get() == 1) {
if (_param_sys_hitl.get() <= 0) {
_mixing_output.setMaxTopicUpdateRate(MIN_TOPIC_UPDATE_INTERVAL);
}

Expand Down
12 changes: 0 additions & 12 deletions src/drivers/px4io/px4io_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@
#include <px4_platform_common/px4_config.h>
#include <parameters/param.h>

/**
* Set usage of IO board
*
* Can be used to use a configure the use of the IO board.
*
* @value 0 IO PWM disabled (RC only)
* @value 1 IO enabled (RC & PWM)
* @reboot_required true
* @group System
*/
PARAM_DEFINE_INT32(SYS_USE_IO, 0);

/**
* S.BUS out
*
Expand Down

0 comments on commit 19b681c

Please sign in to comment.