From 8706d663d5121b56277a1f17ca40384087e20189 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Tue, 15 Dec 2020 22:57:14 +0100 Subject: [PATCH] upstream changes taken over --- devicehandlers/CMakeLists.txt | 11 +++++++++++ devicehandlers/DeviceHandlerBase.h | 1 + devicehandlers/DeviceHandlerIF.h | 10 +++++----- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 devicehandlers/CMakeLists.txt diff --git a/devicehandlers/CMakeLists.txt b/devicehandlers/CMakeLists.txt new file mode 100644 index 00000000..50c1008f --- /dev/null +++ b/devicehandlers/CMakeLists.txt @@ -0,0 +1,11 @@ +target_sources(${LIB_FSFW_NAME} + PRIVATE + AssemblyBase.cpp + ChildHandlerBase.cpp + ChildHandlerFDIR.cpp + DeviceHandlerBase.cpp + DeviceHandlerFailureIsolation.cpp + DeviceHandlerMessage.cpp + DeviceTmReportingWrapper.cpp + HealthDevice.cpp +) \ No newline at end of file diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 2bfa62a6..9a5287e0 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -746,6 +746,7 @@ protected: /** * Helper function to get pending command. This is useful for devices * like SPI sensors to identify the last sent command. + * This only returns the command sent in the last SEND_WRITE cycle. * @return */ DeviceCommandId_t getPendingCommand() const; diff --git a/devicehandlers/DeviceHandlerIF.h b/devicehandlers/DeviceHandlerIF.h index 12036bf1..dba6b228 100644 --- a/devicehandlers/DeviceHandlerIF.h +++ b/devicehandlers/DeviceHandlerIF.h @@ -22,10 +22,10 @@ using DeviceCommandId_t = uint32_t; */ class DeviceHandlerIF { public: - static const DeviceCommandId_t NO_COMMAND = -1; + static constexpr DeviceCommandId_t NO_COMMAND = -1; - static const uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20; - static const uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10; + static constexpr uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20; + static constexpr uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10; using dh_heater_request_t = uint8_t; using dh_thermal_state_t = int8_t; @@ -144,7 +144,7 @@ public: * This is used by the child class to tell the base class what to do. */ enum CommunicationAction: uint8_t { - PERFORM_OPERATION, + PERFORM_OPERATION, SEND_WRITE,//!< Send write GET_WRITE, //!< Get write SEND_READ, //!< Send read @@ -155,7 +155,7 @@ public: static constexpr uint32_t DEFAULT_THERMAL_SET_ID = sid_t::INVALID_SET_ID - 1; static constexpr lp_id_t DEFAULT_THERMAL_STATE_POOL_ID = - localpool::INVALID_LPID - 2; + localpool::INVALID_LPID - 2; static constexpr lp_id_t DEFAULT_THERMAL_HEATING_REQUEST_POOL_ID = localpool::INVALID_LPID - 1;