cache wdt state
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-10-11 15:00:15 +02:00
parent eb1b9c837f
commit 4e3229f018
Signed by: muellerr
GPG Key ID: FCE0B2BD2195142F
3 changed files with 11 additions and 6 deletions

View File

@ -43,11 +43,13 @@ ReturnValue_t XiphosWdtHandler::performOperation(uint8_t opCode) {
sif::warning << "Can not handle message with message type " << command.getMessageType() sif::warning << "Can not handle message with message type " << command.getMessageType()
<< std::endl; << std::endl;
} }
int retval = xsc_watchdog_keepalive(wdtHandle); if (enabled) {
if (retval != 0) { int retval = xsc_watchdog_keepalive(wdtHandle);
sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << retval << ": " if (retval != 0) {
<< strerror(retval) << std::endl; sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << retval << ": "
return returnvalue::FAILED; << strerror(retval) << std::endl;
return returnvalue::FAILED;
}
} }
return returnvalue::OK; return returnvalue::OK;
} }
@ -91,6 +93,7 @@ ReturnValue_t XiphosWdtHandler::enableWdt() {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
} }
enabled = true;
return returnvalue::OK; return returnvalue::OK;
} }
@ -112,6 +115,7 @@ ReturnValue_t XiphosWdtHandler::disableWdt() {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
} }
enabled = false;
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -27,6 +27,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public
// WARNING: DO NOT SET THIS HIGHER THAN 80 SECONDS! // WARNING: DO NOT SET THIS HIGHER THAN 80 SECONDS!
// Possible bug in Xiphos/Xilinx kernel driver for watchdog, related to overflow. // Possible bug in Xiphos/Xilinx kernel driver for watchdog, related to overflow.
int timeoutSeconds = 80; int timeoutSeconds = 80;
bool enabled = false;
struct watchdog_s* wdtHandle = nullptr; struct watchdog_s* wdtHandle = nullptr;
MessageQueueIF* requestQueue = nullptr; MessageQueueIF* requestQueue = nullptr;
ActionHelper actionHelper; ActionHelper actionHelper;

2
tmtc

@ -1 +1 @@
Subproject commit aba369f11f928aefe570f18651bd72ce98953961 Subproject commit dcae930895b3debca5a5b615fc20cded7c3d0e89