|
|
|
@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
* |
|
|
|
|
* Copyright (c) 2020 PX4 Development Team. All rights reserved. |
|
|
|
|
* Copyright (c) 2020, 2021 PX4 Development Team. All rights reserved. |
|
|
|
|
* |
|
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
|
* modification, are permitted provided that the following conditions |
|
|
|
@ -158,7 +158,7 @@ void Magnetometer::ParametersUpdate()
@@ -158,7 +158,7 @@ void Magnetometer::ParametersUpdate()
|
|
|
|
|
|
|
|
|
|
if (_external) { |
|
|
|
|
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) { |
|
|
|
|
PX4_ERR("External %s %d (%d) invalid rotation %d, resetting to rotation none", |
|
|
|
|
PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", |
|
|
|
|
SensorString(), _device_id, _calibration_index, rotation_value); |
|
|
|
|
rotation_value = ROTATION_NONE; |
|
|
|
|
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value); |
|
|
|
@ -169,7 +169,7 @@ void Magnetometer::ParametersUpdate()
@@ -169,7 +169,7 @@ void Magnetometer::ParametersUpdate()
|
|
|
|
|
} else { |
|
|
|
|
// internal mag, CAL_MAGx_ROT -1
|
|
|
|
|
if (rotation_value != -1) { |
|
|
|
|
PX4_ERR("Internal %s %d (%d) invalid rotation %d, resetting", |
|
|
|
|
PX4_ERR("Internal %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 " resetting", |
|
|
|
|
SensorString(), _device_id, _calibration_index, rotation_value); |
|
|
|
|
SetCalibrationParam(SensorString(), "ROT", _calibration_index, -1); |
|
|
|
|
} |
|
|
|
@ -186,8 +186,8 @@ void Magnetometer::ParametersUpdate()
@@ -186,8 +186,8 @@ void Magnetometer::ParametersUpdate()
|
|
|
|
|
int32_t new_priority = _external ? DEFAULT_EXTERNAL_PRIORITY : DEFAULT_PRIORITY; |
|
|
|
|
|
|
|
|
|
if (_priority != -1) { |
|
|
|
|
PX4_ERR("%s %d (%d) invalid priority %d, resetting to %d", SensorString(), _device_id, _calibration_index, _priority, |
|
|
|
|
new_priority); |
|
|
|
|
PX4_ERR("%s %" PRIu32 " (%" PRId8 ") invalid priority %" PRId32 ", resetting to %" PRId32, SensorString(), _device_id, |
|
|
|
|
_calibration_index, _priority, new_priority); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SetCalibrationParam(SensorString(), "PRIO", _calibration_index, new_priority); |
|
|
|
@ -267,14 +267,14 @@ bool Magnetometer::ParametersSave()
@@ -267,14 +267,14 @@ bool Magnetometer::ParametersSave()
|
|
|
|
|
void Magnetometer::PrintStatus() |
|
|
|
|
{ |
|
|
|
|
if (external()) { |
|
|
|
|
PX4_INFO("%s %d EN: %d, offset: [% 05.3f % 05.3f % 05.3f], scale: [% 05.3f % 05.3f % 05.3f], External ROT: %d", |
|
|
|
|
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [% 05.3f % 05.3f % 05.3f], scale: [% 05.3f % 05.3f % 05.3f], External ROT: %d", |
|
|
|
|
SensorString(), device_id(), enabled(), |
|
|
|
|
(double)_offset(0), (double)_offset(1), (double)_offset(2), |
|
|
|
|
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2), |
|
|
|
|
rotation_enum()); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
PX4_INFO("%s %d EN: %d, offset: [% 05.3f % 05.3f % 05.3f], scale: [% 05.3f % 05.3f % 05.3f], Internal", |
|
|
|
|
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [% 05.3f % 05.3f % 05.3f], scale: [% 05.3f % 05.3f % 05.3f], Internal", |
|
|
|
|
SensorString(), device_id(), enabled(), |
|
|
|
|
(double)_offset(0), (double)_offset(1), (double)_offset(2), |
|
|
|
|
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2)); |
|
|
|
|