mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_DAL: add and use compass.available()
Covers both being enabled and initialised
This commit is contained in:
parent
658c978c9d
commit
74859095a9
@ -17,6 +17,7 @@ void AP_DAL_Compass::start_frame()
|
||||
const auto &compass = AP::compass();
|
||||
|
||||
const log_RMGH old = _RMGH;
|
||||
_RMGH.available = compass.available();
|
||||
_RMGH.count = compass.get_count();
|
||||
_RMGH.auto_declination_enabled = compass.auto_declination_enabled();
|
||||
_RMGH.declination = compass.get_declination();
|
||||
|
@ -38,6 +38,10 @@ public:
|
||||
return _RMGH.declination;
|
||||
}
|
||||
|
||||
bool available() const {
|
||||
return _RMGH.available;
|
||||
}
|
||||
|
||||
// return the number of enabled sensors
|
||||
uint8_t get_num_enabled(void) const { return _RMGH.num_enabled; }
|
||||
|
||||
|
@ -240,6 +240,7 @@ struct log_RASI {
|
||||
// @Description: Replay Data Magnetometer Header
|
||||
struct log_RMGH {
|
||||
float declination;
|
||||
bool available;
|
||||
uint8_t count;
|
||||
bool auto_declination_enabled;
|
||||
uint8_t num_enabled;
|
||||
@ -402,7 +403,7 @@ struct log_RBOH {
|
||||
{ LOG_RGPJ_MSG, RLOG_SIZE(RGPJ), \
|
||||
"RGPJ", "IffffffIiiiffHB", "TS,VX,VY,VZ,SA,Y,YA,YT,Lat,Lon,Alt,HA,VA,HD,I", "--------------#", "---------------" }, \
|
||||
{ LOG_RMGH_MSG, RLOG_SIZE(RMGH), \
|
||||
"RMGH", "BBfBBBB", "Dec,NumInst,AutoDec,NumEna,LOE,C,FUsable", "-------", "-------" }, \
|
||||
"RMGH", "BBBfBBBB", "Dec,Avail,NumInst,AutoDec,NumEna,LOE,C,FUsable", "--------", "--------" }, \
|
||||
{ LOG_RMGI_MSG, RLOG_SIZE(RMGI), \
|
||||
"RMGI", "IffffffBBBB", "LU,OX,OY,OZ,FX,FY,FZ,UFY,H,HSF,I", "----------#", "-----------" }, \
|
||||
{ LOG_RBCH_MSG, RLOG_SIZE(RBCH), \
|
||||
|
Loading…
Reference in New Issue
Block a user