Skip to content
Snippets Groups Projects
Commit 0d969334 authored by Beat Küng's avatar Beat Küng Committed by Roman Bapst
Browse files

fmu + px4io: fixes for MC_AIRMODE parameter

- fmu: in case of _mot_t_max==0 _airmode was not set in the mixer
- px4io: param_val is a float
parent 99ce9cc2
No related branches found
No related tags found
No related merge requests found
......@@ -1294,7 +1294,6 @@ PX4FMU::cycle()
// factor 2 is needed because actuator outputs are in the range [-1,1]
const float delta_out_max = 2.0f * 1000.0f * dt / (_max_pwm[0] - _min_pwm[0]) / _mot_t_max;
_mixers->set_max_delta_out_once(delta_out_max);
_mixers->set_airmode(_airmode);
}
if (_thr_mdl_fac > FLT_EPSILON) {
......@@ -1363,6 +1362,8 @@ PX4FMU::cycle()
ORB_PRIO_DEFAULT);
}
_mixers->set_airmode(_airmode);
perf_end(_ctl_latency);
}
}
......@@ -1791,7 +1792,7 @@ void PX4FMU::update_params()
param_handle = param_find("MC_AIRMODE");
if (param_handle != PARAM_INVALID) {
int val;
int32_t val;
param_get(param_handle, &val);
_airmode = val > 0;
PX4_DEBUG("%s: %d", "MC_AIRMODE", _airmode);
......
......@@ -1226,8 +1226,9 @@ PX4IO::task_main()
parm_handle = param_find("MC_AIRMODE");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_AIRMODE, SIGNED_TO_REG(param_val));
int32_t param_val_int;
param_get(parm_handle, &param_val_int);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_AIRMODE, SIGNED_TO_REG(param_val_int));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment