commander: update parameter strings to class enum

This commit is contained in:
Daniel Agar
2019-10-02 19:43:32 -04:00
parent 508ffa1b39
commit c322f1d156
8 changed files with 73 additions and 70 deletions
@@ -42,6 +42,7 @@
#include "commander_helper.h"
#include <px4_defines.h>
#include <px4_param.h>
#include <px4_posix.h>
#include <px4_time.h>
#include <stdio.h>
@@ -106,7 +107,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
/* only warn if analog scaling is zero */
float analog_scaling = 0.0f;
param_get(param_find("SENS_DPRES_ANSC"), &(analog_scaling));
param_get(param_handle(px4::params::SENS_DPRES_ANSC), &(analog_scaling));
if (fabsf(analog_scaling) < 0.1f) {
calibration_log_critical(mavlink_log_pub, "[cal] No airspeed sensor found");
@@ -114,7 +115,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
}
/* set scaling offset parameter */
if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
if (param_set(param_handle(px4::params::SENS_DPRES_OFF), &(diff_pres_offset))) {
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
goto error_return;
}
@@ -185,7 +186,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
diff_pres_offset = 0.00000001f;
}
if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
if (param_set(param_handle(px4::params::SENS_DPRES_OFF), &(diff_pres_offset))) {
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
goto error_return;
}
@@ -236,7 +237,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
/* the user setup is wrong, wipe the calibration to force a proper re-calibration */
diff_pres_offset = 0.0f;
if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
if (param_set(param_handle(px4::params::SENS_DPRES_OFF), &(diff_pres_offset))) {
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
goto error_return;
}