From cd9cb48b04ef9ea7e65cb0f7c8a1c36c17914f24 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 5 Jul 2023 16:31:41 +0200 Subject: [PATCH 1/3] set dataset invalid on OFF mode --- mission/tcs/Tmp1075Handler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/tcs/Tmp1075Handler.cpp b/mission/tcs/Tmp1075Handler.cpp index 30331e1f..905219ca 100644 --- a/mission/tcs/Tmp1075Handler.cpp +++ b/mission/tcs/Tmp1075Handler.cpp @@ -19,6 +19,7 @@ void Tmp1075Handler::doStartUp() { void Tmp1075Handler::doShutDown() { communicationStep = CommunicationStep::START_ADC_CONVERSION; + dataset.setValidity(false, true); setMode(_MODE_POWER_DOWN); } From 52eba5cae6d3b1d10f8be8d1818ee0f66ad91fb3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 5 Jul 2023 17:20:42 +0200 Subject: [PATCH 2/3] small fix/tweaks --- CHANGELOG.md | 5 +++++ mission/system/tcs/TmpDevFdir.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38d76dac..68caa64b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- TMP1075: Set dataset invalid on shutdown explicitely +- Small fixes for TMP1075 FDIR: Use strange and missed reply counters. + # [v6.0.0] 2023-07-02 - `q7s-package` version v3.2.0 diff --git a/mission/system/tcs/TmpDevFdir.cpp b/mission/system/tcs/TmpDevFdir.cpp index d501dd1a..e191f7fb 100644 --- a/mission/system/tcs/TmpDevFdir.cpp +++ b/mission/system/tcs/TmpDevFdir.cpp @@ -20,7 +20,7 @@ ReturnValue_t TmpDevFdir::eventReceived(EventMessage* event) { // We'll try a recovery as long as defined in MAX_REBOOT. // Might cause some AssemblyBase cycles, so keep number low. // Ignored for TMP device, no way to power cycle it without going to OFF/BOOT mode. - // handleRecovery(event->getEvent()); + setFaulty(event->getEvent()); break; case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED: case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED: @@ -29,7 +29,9 @@ ReturnValue_t TmpDevFdir::eventReceived(EventMessage* event) { case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED: // These faults all mean that there were stupid replies from a device. // With now way to do a recovery, set the device to faulty immediately. - setFaulty(event->getEvent()); + if (strangeReplyCount.incrementAndCheck()) { + setFaulty(event->getEvent()); + } break; case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: @@ -40,7 +42,9 @@ ReturnValue_t TmpDevFdir::eventReceived(EventMessage* event) { break; } // else - setFaulty(event->getEvent()); + if (missedReplyCount.incrementAndCheck()) { + setFaulty(event->getEvent()); + } break; case StorageManagerIF::GET_DATA_FAILED: case StorageManagerIF::STORE_DATA_FAILED: From f4f365b11016a8bb05d1e28e3810a951237339d1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 6 Jul 2023 13:56:43 +0200 Subject: [PATCH 3/3] pool read guard --- mission/tcs/Tmp1075Handler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/tcs/Tmp1075Handler.cpp b/mission/tcs/Tmp1075Handler.cpp index 905219ca..3f2da98f 100644 --- a/mission/tcs/Tmp1075Handler.cpp +++ b/mission/tcs/Tmp1075Handler.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -19,6 +20,7 @@ void Tmp1075Handler::doStartUp() { void Tmp1075Handler::doShutDown() { communicationStep = CommunicationStep::START_ADC_CONVERSION; + PoolReadGuard pg(&dataset); dataset.setValidity(false, true); setMode(_MODE_POWER_DOWN); }