AP_Compass: added force_save_calibration()
This commit is contained in:
parent
25dd08a1fd
commit
f8e0227c8c
@ -2020,6 +2020,17 @@ void Compass::handle_external(const AP_ExternalAHRS::mag_data_message_t &pkt)
|
|||||||
}
|
}
|
||||||
#endif // HAL_EXTERNAL_AHRS_ENABLED
|
#endif // HAL_EXTERNAL_AHRS_ENABLED
|
||||||
|
|
||||||
|
// force save of current calibration as valid
|
||||||
|
void Compass::force_save_calibration(void)
|
||||||
|
{
|
||||||
|
for (StateIndex i(0); i<COMPASS_MAX_INSTANCES; i++) {
|
||||||
|
if (_state[i].dev_id != 0) {
|
||||||
|
_state[i].dev_id.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// singleton instance
|
// singleton instance
|
||||||
Compass *Compass::_singleton;
|
Compass *Compass::_singleton;
|
||||||
|
|
||||||
|
@ -355,6 +355,9 @@ public:
|
|||||||
void handle_external(const AP_ExternalAHRS::mag_data_message_t &pkt);
|
void handle_external(const AP_ExternalAHRS::mag_data_message_t &pkt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// force save of current calibration as valid
|
||||||
|
void force_save_calibration(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Compass *_singleton;
|
static Compass *_singleton;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user