mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 23:51:36 +08:00
change main trims to normalized values
This commit is contained in:
committed by
Lorenz Meier
parent
dbc149c224
commit
f0b41a0e52
@@ -1207,12 +1207,12 @@ PX4IO::task_main()
|
||||
// update trim values
|
||||
struct pwm_output_values pwm_values;
|
||||
|
||||
memset(&pwm_values, 0, sizeof(pwm_values));
|
||||
ret = io_reg_get(PX4IO_PAGE_CONTROL_TRIM_PWM, 0, (uint16_t *)pwm_values.values, _max_actuators);
|
||||
// memset(&pwm_values, 0, sizeof(pwm_values));
|
||||
// ret = io_reg_get(PX4IO_PAGE_CONTROL_TRIM_PWM, 0, (uint16_t *)pwm_values.values, _max_actuators);
|
||||
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
char pname[16];
|
||||
int32_t ival;
|
||||
float pval;
|
||||
|
||||
/* fetch the trim values from parameters */
|
||||
sprintf(pname, "PWM_MAIN_TRIM%u", i + 1);
|
||||
@@ -1220,8 +1220,8 @@ PX4IO::task_main()
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
|
||||
param_get(param_h, &ival);
|
||||
pwm_values.values[i] = ival;
|
||||
param_get(param_h, &pval);
|
||||
pwm_values.values[i] = (int16_t)(10000 * pval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user