mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-24 16:01:53 +08:00
fix(commander): build mag calibration only with CONFIG_SENSORS_VEHICLE_MAGNETOMETER (#28555)
Boards that compile the magnetometer pipeline out still linked 8.6 KB of calibration that could never run. holybro_kakutef7 is one of them and sits at 100 % of flash on main. The calibration commands answer UNSUPPORTED there.
This commit is contained in:
1 parent
29120280ac
commit
6dc89338a8
3 files changed
+33
-6
No files matched your search
@@ -39,7 +39,9 @@
|
||||
#include "esc_calibration.h"
|
||||
#include "gyro_calibration.h"
|
||||
#include "level_calibration.h"
|
||||
#if defined(CONFIG_SENSORS_VEHICLE_MAGNETOMETER)
|
||||
#include "mag_calibration.h"
|
||||
#endif
|
||||
#include "rc_calibration.h"
|
||||
|
||||
#include <px4_platform_common/events.h>
|
||||
@@ -111,10 +113,23 @@ void WorkerThread::threadEntry()
|
||||
_ret_value = do_gyro_calibration(&_mavlink_log_pub);
|
||||
break;
|
||||
|
||||
#if defined(CONFIG_SENSORS_VEHICLE_MAGNETOMETER)
|
||||
|
||||
case Request::MagCalibration:
|
||||
_ret_value = do_mag_calibration(&_mavlink_log_pub);
|
||||
break;
|
||||
|
||||
case Request::MagCalibrationQuick:
|
||||
_ret_value = do_mag_calibration_quick(&_mavlink_log_pub, _heading_radians, _latitude, _longitude);
|
||||
break;
|
||||
#else
|
||||
|
||||
case Request::MagCalibration:
|
||||
case Request::MagCalibrationQuick:
|
||||
_ret_value = -1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case Request::RCTrimCalibration:
|
||||
_ret_value = do_trim_calibration(&_mavlink_log_pub);
|
||||
break;
|
||||
@@ -139,10 +154,6 @@ void WorkerThread::threadEntry()
|
||||
_ret_value = do_esc_calibration(&_mavlink_log_pub);
|
||||
break;
|
||||
|
||||
case Request::MagCalibrationQuick:
|
||||
_ret_value = do_mag_calibration_quick(&_mavlink_log_pub, _heading_radians, _latitude, _longitude);
|
||||
break;
|
||||
|
||||
case Request::BaroCalibration:
|
||||
_ret_value = do_baro_calibration(&_mavlink_log_pub);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user