px4io driver: send roll, pitch and yaw scale parameter values to io

Signed-off-by: Roman <bapstr@ethz.ch>
This commit is contained in:
Roman 2016-07-12 13:49:32 +02:00 committed by Andreas Antener
parent 08bbd6dbfa
commit 13905c2480
1 changed files with 28 additions and 7 deletions

View File

@ -1166,28 +1166,49 @@ PX4IO::task_main()
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_PWM_REVERSE, pwm_invert_mask);
float trim_val;
float param_val;
param_t parm_handle;
parm_handle = param_find("TRIM_ROLL");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &trim_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_ROLL, FLOAT_TO_REG(trim_val));
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_ROLL, FLOAT_TO_REG(param_val));
}
parm_handle = param_find("TRIM_PITCH");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &trim_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_PITCH, FLOAT_TO_REG(trim_val));
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_PITCH, FLOAT_TO_REG(param_val));
}
parm_handle = param_find("TRIM_YAW");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &trim_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_YAW, FLOAT_TO_REG(trim_val));
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_TRIM_YAW, FLOAT_TO_REG(param_val));
}
parm_handle = param_find("FW_MAN_R_SC");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_SCALE_ROLL, FLOAT_TO_REG(param_val));
}
parm_handle = param_find("FW_MAN_P_SC");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_SCALE_PITCH, FLOAT_TO_REG(param_val));
}
parm_handle = param_find("FW_MAN_Y_SC");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_SCALE_YAW, FLOAT_TO_REG(param_val));
}
/* S.BUS output */