From 6e4ce35fca4cef6f1e5895afe03f518805632d5a Mon Sep 17 00:00:00 2001 From: Gone4Dirt Date: Fri, 12 Jan 2024 02:50:37 +0000 Subject: [PATCH] AP_Temperature: Add DroneCAN source --- .../AP_TemperatureSensor/AP_TemperatureSensor_Backend.cpp | 3 +++ libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.cpp | 2 +- libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Backend.cpp b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Backend.cpp index e1a68421e2..cab984c649 100644 --- a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Backend.cpp +++ b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Backend.cpp @@ -90,6 +90,9 @@ void AP_TemperatureSensor_Backend::update_external_libraries(const float tempera AP::battery().set_temperature_by_serial_number(temperature, _params.source_id); break; #endif + case AP_TemperatureSensor_Params::Source::DroneCAN: + // Label only, used by AP_Periph + break; case AP_TemperatureSensor_Params::Source::None: case AP_TemperatureSensor_Params::Source::Pitot_tube: diff --git a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.cpp b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.cpp index 361eaf9c13..25caea8647 100644 --- a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.cpp +++ b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.cpp @@ -58,7 +58,7 @@ const AP_Param::GroupInfo AP_TemperatureSensor_Params::var_info[] = { // @Param: SRC // @DisplayName: Sensor Source // @Description: Sensor Source is used to designate which device's temperature report will be replaced by this temperature sensor's data. If 0 (None) then the data is only available via log. In the future a new Motor temperature report will be created for returning data directly. - // @Values: 0: None, 1:ESC, 2:Motor(not implemented yet), 3:Battery Index, 4:Battery ID/SerialNumber, 5: CAN based Pitot tube + // @Values: 0: None, 1:ESC, 2:Motor, 3:Battery Index, 4:Battery ID/SerialNumber, 5:CAN based Pitot tube, 6:DroneCAN-out on AP_Periph // @User: Standard AP_GROUPINFO("SRC", 4, AP_TemperatureSensor_Params, source, (float)Source::None), diff --git a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.h b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.h index 46d41e8c65..73d60a40d5 100644 --- a/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.h +++ b/libraries/AP_TemperatureSensor/AP_TemperatureSensor_Params.h @@ -43,6 +43,7 @@ public: Battery_Index = 3, Battery_ID_SerialNumber = 4, Pitot_tube = 5, + DroneCAN = 6, }; AP_Enum type; // 0=disabled, others see frontend enum TYPE