Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACKPORT v1.14] Remove SYS_USE_IO param #22339

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -266,32 +266,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 @@ -302,6 +296,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,6 +16,4 @@ 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

safety_button start
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
1 change: 0 additions & 1 deletion boards/px4/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ 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

safety_button start
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
Loading