Set CAL_MAG_ID correctly

This commit is contained in:
Don Gagne
2015-03-26 10:45:56 -07:00
committed by Lorenz Meier
parent d88916d20e
commit 48e88ec551
+3 -1
View File
@@ -111,7 +111,7 @@ int do_mag_calibration(int mavlink_fd)
for (unsigned cur_mag = 0; cur_mag < max_mags; cur_mag++) {
// Reset mag id to mag not available
(void)sprintf(str, "CAL_MAG%u_ID", cur_mag);
result = param_set_no_notification(param_find(str), &(device_ids[cur_mag]));;
result = param_set_no_notification(param_find(str), &(device_ids[cur_mag]));
if (result != OK) {
mavlink_and_console_log_info(mavlink_fd, "Unabled to reset CAL_MAG%u_ID", cur_mag);
break;
@@ -430,6 +430,8 @@ int mag_calibrate_all(int mavlink_fd, int32_t (&device_ids)[max_mags])
bool failed = false;
/* set parameters */
(void)sprintf(str, "CAL_MAG%u_ID", cur_mag);
failed |= (OK != param_set_no_notification(param_find(str), &(device_ids[cur_mag])));
(void)sprintf(str, "CAL_MAG%u_XOFF", cur_mag);
failed |= (OK != param_set_no_notification(param_find(str), &(mscale.x_offset)));
(void)sprintf(str, "CAL_MAG%u_YOFF", cur_mag);