AP_Airspeed: Move multi-line functions out of header
This commit is contained in:
parent
b659360d64
commit
edb25340d1
@ -737,6 +737,24 @@ bool AP_Airspeed::all_healthy(void) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return true if airspeed is enabled
|
||||||
|
bool AP_Airspeed::enabled(uint8_t i) const {
|
||||||
|
if (i < AIRSPEED_MAX_SENSORS) {
|
||||||
|
return param[i].type.get() != TYPE_NONE;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return health status of sensor
|
||||||
|
bool AP_Airspeed::healthy(uint8_t i) const {
|
||||||
|
bool ok = state[i].healthy && enabled(i);
|
||||||
|
#ifndef HAL_BUILD_AP_PERIPH
|
||||||
|
// sanity check the offset parameter. Zero is permitted if we are skipping calibration.
|
||||||
|
ok &= (fabsf(param[i].offset) > 0 || state[i].use_zero_offset || param[i].skip_cal);
|
||||||
|
#endif
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
#else // build type is not appropriate; provide a dummy implementation:
|
#else // build type is not appropriate; provide a dummy implementation:
|
||||||
const AP_Param::GroupInfo AP_Airspeed::var_info[] = { AP_GROUPEND };
|
const AP_Param::GroupInfo AP_Airspeed::var_info[] = { AP_GROUPEND };
|
||||||
|
|
||||||
@ -744,6 +762,8 @@ void AP_Airspeed::update() {};
|
|||||||
bool AP_Airspeed::get_temperature(uint8_t i, float &temperature) { return false; }
|
bool AP_Airspeed::get_temperature(uint8_t i, float &temperature) { return false; }
|
||||||
void AP_Airspeed::calibrate(bool in_startup) {}
|
void AP_Airspeed::calibrate(bool in_startup) {}
|
||||||
bool AP_Airspeed::use(uint8_t i) const { return false; }
|
bool AP_Airspeed::use(uint8_t i) const { return false; }
|
||||||
|
bool AP_Airspeed::enabled(uint8_t i) const { return false; }
|
||||||
|
bool AP_Airspeed::healthy(uint8_t i) const { return false; }
|
||||||
|
|
||||||
#if HAL_MSP_AIRSPEED_ENABLED
|
#if HAL_MSP_AIRSPEED_ENABLED
|
||||||
void AP_Airspeed::handle_msp(const MSP::msp_airspeed_data_message_t &pkt) {}
|
void AP_Airspeed::handle_msp(const MSP::msp_airspeed_data_message_t &pkt) {}
|
||||||
|
@ -110,12 +110,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return true if airspeed is enabled
|
// return true if airspeed is enabled
|
||||||
bool enabled(uint8_t i) const {
|
bool enabled(uint8_t i) const;
|
||||||
if (i < AIRSPEED_MAX_SENSORS) {
|
|
||||||
return param[i].type.get() != TYPE_NONE;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool enabled(void) const { return enabled(primary); }
|
bool enabled(void) const { return enabled(primary); }
|
||||||
|
|
||||||
// return the differential pressure in Pascal for the last airspeed reading
|
// return the differential pressure in Pascal for the last airspeed reading
|
||||||
@ -128,14 +123,7 @@ public:
|
|||||||
void update_calibration(const Vector3f &vground, int16_t max_airspeed_allowed_during_cal);
|
void update_calibration(const Vector3f &vground, int16_t max_airspeed_allowed_during_cal);
|
||||||
|
|
||||||
// return health status of sensor
|
// return health status of sensor
|
||||||
bool healthy(uint8_t i) const {
|
bool healthy(uint8_t i) const;
|
||||||
bool ok = state[i].healthy && enabled(i);
|
|
||||||
#ifndef HAL_BUILD_AP_PERIPH
|
|
||||||
// sanity check the offset parameter. Zero is permitted if we are skipping calibration.
|
|
||||||
ok &= (fabsf(param[i].offset) > 0 || state[i].use_zero_offset || param[i].skip_cal);
|
|
||||||
#endif
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
bool healthy(void) const { return healthy(primary); }
|
bool healthy(void) const { return healthy(primary); }
|
||||||
|
|
||||||
// return true if all enabled sensors are healthy
|
// return true if all enabled sensors are healthy
|
||||||
|
Loading…
Reference in New Issue
Block a user