From ecd21fbc4cfa1f8707ecbfbcbdde00ddfc6319b4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 4 Jan 2021 11:51:04 +1100 Subject: [PATCH] AP_TemperatureSensor: add support for simulated TSYS01 temperature sensor --- libraries/AP_TemperatureSensor/TSYS01.cpp | 3 --- libraries/AP_TemperatureSensor/TSYS01.h | 7 ------- 2 files changed, 10 deletions(-) diff --git a/libraries/AP_TemperatureSensor/TSYS01.cpp b/libraries/AP_TemperatureSensor/TSYS01.cpp index 86d83b0939..730febfb1b 100644 --- a/libraries/AP_TemperatureSensor/TSYS01.cpp +++ b/libraries/AP_TemperatureSensor/TSYS01.cpp @@ -15,9 +15,6 @@ static const uint8_t TSYS01_CMD_READ_ADC = 0x00; bool TSYS01::init(uint8_t bus) { -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL - return false; -#endif _dev = std::move(hal.i2c_mgr->get_device(bus, TSYS01_ADDR)); if (!_dev) { printf("TSYS01 device is null!"); diff --git a/libraries/AP_TemperatureSensor/TSYS01.h b/libraries/AP_TemperatureSensor/TSYS01.h index 5c19234f8a..6ded0190c1 100644 --- a/libraries/AP_TemperatureSensor/TSYS01.h +++ b/libraries/AP_TemperatureSensor/TSYS01.h @@ -16,20 +16,13 @@ public: bool init(uint8_t bus); float temperature(void) { return _temperature; } // temperature in degrees C bool healthy(void) { // do we have a valid temperature reading? -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL - return true; -#endif return _healthy; } AP_HAL::OwnPtr _dev; private: -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL - float _temperature = 42.42; // degrees C -#else float _temperature; // degrees C -#endif bool _healthy; // we have a valid temperature reading to report uint16_t _k[5]; // internal calibration for temperature calculation bool _reset(void); // reset device