mirror of https://github.com/ArduPilot/ardupilot
Sub: use new AP_TemperatureSensor library
Co-authored-by: Joshua Henderson <hendjoshsr71@gmail.com>
This commit is contained in:
parent
b4bb5c71ac
commit
be42e53303
|
@ -96,7 +96,9 @@ int16_t GCS_MAVLINK_Sub::vfr_hud_throttle() const
|
|||
// Work around to get temperature sensor data out
|
||||
void GCS_MAVLINK_Sub::send_scaled_pressure3()
|
||||
{
|
||||
if (!sub.celsius.healthy()) {
|
||||
#if AP_TEMPERATURE_SENSOR_ENABLED
|
||||
float temperature;
|
||||
if (!sub.temperature_sensor.temperature(temperature)) {
|
||||
return;
|
||||
}
|
||||
mavlink_msg_scaled_pressure3_send(
|
||||
|
@ -104,8 +106,9 @@ void GCS_MAVLINK_Sub::send_scaled_pressure3()
|
|||
AP_HAL::millis(),
|
||||
0,
|
||||
0,
|
||||
sub.celsius.temperature() * 100,
|
||||
temperature * 100,
|
||||
0); // TODO: use differential pressure temperature
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GCS_MAVLINK_Sub::send_info()
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
#include <AP_Terrain/AP_Terrain.h>
|
||||
#include <AP_JSButton/AP_JSButton.h> // Joystick/gamepad button function assignment
|
||||
#include <AP_LeakDetector/AP_LeakDetector.h> // Leak detector
|
||||
#include <AP_TemperatureSensor/TSYS01.h>
|
||||
#include <AP_Proximity/AP_Proximity.h>
|
||||
|
||||
// Local modules
|
||||
|
@ -138,8 +137,6 @@ private:
|
|||
|
||||
AP_LeakDetector leak_detector;
|
||||
|
||||
TSYS01 celsius;
|
||||
|
||||
struct {
|
||||
bool enabled:1;
|
||||
bool alt_healthy:1; // true if we can trust the altitude from the rangefinder
|
||||
|
|
|
@ -48,7 +48,11 @@ void Sub::init_ardupilot()
|
|||
#elif CONFIG_HAL_BOARD != HAL_BOARD_LINUX
|
||||
AP_Param::set_default_by_name("BARO_EXT_BUS", 1);
|
||||
#endif
|
||||
celsius.init(barometer.external_bus());
|
||||
|
||||
#if AP_TEMPERATURE_SENSOR_ENABLED
|
||||
// In order to preserve Sub's previous AP_TemperatureSensor Behavior we set the Default I2C Bus Here
|
||||
AP_Param::set_default_by_name("TEMP1_BUS", barometer.external_bus());
|
||||
#endif
|
||||
|
||||
// setup telem slots with serial ports
|
||||
gcs().setup_uarts();
|
||||
|
|
Loading…
Reference in New Issue