diff options
author | Don Gagne <don@thegagnes.com> | 2015-03-26 10:45:56 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-03-28 13:09:07 -0700 |
commit | 48e88ec5516c0f9de97f4de7e0ee412e5f82eb71 (patch) | |
tree | d095b7d9b0b90bd11c256978f27a66c0f8769432 /src | |
parent | d88916d20e962ddd60915a80172e83535d526193 (diff) | |
download | px4-firmware-48e88ec5516c0f9de97f4de7e0ee412e5f82eb71.tar.gz px4-firmware-48e88ec5516c0f9de97f4de7e0ee412e5f82eb71.tar.bz2 px4-firmware-48e88ec5516c0f9de97f4de7e0ee412e5f82eb71.zip |
Set CAL_MAG_ID correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/mag_calibration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/commander/mag_calibration.cpp b/src/modules/commander/mag_calibration.cpp index 5f0754f98..bfe73d338 100644 --- a/src/modules/commander/mag_calibration.cpp +++ b/src/modules/commander/mag_calibration.cpp @@ -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); |