/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #include #include "Compass.h" #include extern AP_HAL::HAL& hal; void Compass::compass_cal_update() { AP_Notify::flags.compass_cal_running = 0; for (uint8_t i=0; idelay(1000); hal.scheduler->reboot(false); } } bool Compass::start_calibration(uint8_t i, bool retry, bool autosave, float delay, bool autoreboot) { if (!healthy(i)) { return false; } memset(_reports_sent,0,sizeof(_reports_sent)); if (!is_calibrating() && delay > 0.5f) { AP_Notify::events.initiated_compass_cal = 1; } if (i == get_primary()) { _calibrator[i].set_tolerance(8); } else { _calibrator[i].set_tolerance(16); } _calibrator[i].start(retry, autosave, delay); _compass_cal_autoreboot = autoreboot; return true; } bool Compass::start_calibration_mask(uint8_t mask, bool retry, bool autosave, float delay, bool autoreboot) { for (uint8_t i=0; i