mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-12 18:00:34 +08:00
calibration: shorten too long messages
This commit is contained in:
@@ -414,7 +414,7 @@ int do_accel_calibration(orb_advert_t *mavlink_log_pub)
|
||||
failed |= (PX4_OK != param_set_no_notification(param_find(str), &(device_id[uorb_index])));
|
||||
|
||||
if (failed) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, uorb_index);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG);
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ int do_accel_calibration(orb_advert_t *mavlink_log_pub)
|
||||
}
|
||||
|
||||
if (res != PX4_OK) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG, uorb_index);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,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))) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG);
|
||||
goto error_return;
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
|
||||
}
|
||||
|
||||
if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG);
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
|
||||
diff_pres_offset = 0.0f;
|
||||
|
||||
if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, 1);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG);
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
#define CAL_ERROR_SENSOR_MSG "[cal] calibration failed: reading sensor"
|
||||
#define CAL_ERROR_RESET_CAL_MSG "[cal] calibration failed: to reset, sensor %u"
|
||||
#define CAL_ERROR_APPLY_CAL_MSG "[cal] calibration failed: to apply calibration, sensor %u"
|
||||
#define CAL_ERROR_SET_PARAMS_MSG "[cal] calibration failed: to set parameters, sensor %u"
|
||||
#define CAL_ERROR_APPLY_CAL_MSG "[cal] calibration failed: to apply calibration"
|
||||
#define CAL_ERROR_SET_PARAMS_MSG "[cal] calibration failed: to set parameters"
|
||||
|
||||
#endif /* CALIBRATION_MESSAGES_H_ */
|
||||
|
||||
@@ -487,7 +487,7 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
px4_close(fd);
|
||||
|
||||
if (res != PX4_OK) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG, 1);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -840,7 +840,7 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub)
|
||||
#ifdef __PX4_NUTTX
|
||||
|
||||
if (px4_ioctl(fd_mag, MAGIOCSSCALE, (long unsigned int)&mscale) != PX4_OK) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG, cur_mag);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_APPLY_CAL_MSG);
|
||||
result = calibrate_return_error;
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub)
|
||||
#endif
|
||||
|
||||
if (failed) {
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG, cur_mag);
|
||||
calibration_log_critical(mavlink_log_pub, CAL_ERROR_SET_PARAMS_MSG);
|
||||
result = calibrate_return_error;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user