AP_Vehicle: add AP_TemperatureSensor

Co-authored-by: Joshua Henderson <hendjoshsr71@gmail.com>
This commit is contained in:
Tom Pittenger 2022-09-07 10:17:40 -07:00 committed by Andrew Tridgell
parent ecbfd25c08
commit 1254e18fa9
2 changed files with 19 additions and 0 deletions

View File

@ -106,6 +106,13 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = {
// @Path: ../AP_OpenDroneID/AP_OpenDroneID.cpp
AP_SUBGROUPINFO(opendroneid, "DID_", 15, AP_Vehicle, AP_OpenDroneID),
#endif
#if AP_TEMPERATURE_SENSOR_ENABLED
// @Group: TEMP
// @Path: ../AP_TemperatureSensor/AP_TemperatureSensor.cpp
AP_SUBGROUPINFO(temperature_sensor, "TEMP", 16, AP_Vehicle, AP_TemperatureSensor),
#endif
AP_GROUPEND
};
@ -249,6 +256,10 @@ void AP_Vehicle::setup()
efi.init();
#endif
#if AP_TEMPERATURE_SENSOR_ENABLED
temperature_sensor.init();
#endif
#if AP_AIS_ENABLED
ais.init();
#endif
@ -353,6 +364,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = {
#if OSD_ENABLED
SCHED_TASK(publish_osd_info, 1, 10, 240),
#endif
#if AP_TEMPERATURE_SENSOR_ENABLED
SCHED_TASK_CLASS(AP_TemperatureSensor, &vehicle.temperature_sensor, update, 5, 50, 242),
#endif
#if HAL_INS_ACCELCAL_ENABLED
SCHED_TASK(accel_cal_update, 10, 100, 245),
#endif

View File

@ -51,6 +51,7 @@
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
#include <AP_VideoTX/AP_SmartAudio.h>
#include <AP_VideoTX/AP_Tramp.h>
#include <AP_TemperatureSensor/AP_TemperatureSensor.h>
#include <SITL/SITL.h>
#include <AP_CustomRotations/AP_CustomRotations.h>
#include <AP_AIS/AP_AIS.h>
@ -405,6 +406,10 @@ protected:
AC_Fence fence;
#endif
#if AP_TEMPERATURE_SENSOR_ENABLED
AP_TemperatureSensor temperature_sensor;
#endif
static const struct AP_Param::GroupInfo var_info[];
static const struct AP_Scheduler::Task scheduler_tasks[];