Robin Mueller
4e3229f018
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
37 lines
1.4 KiB
C++
37 lines
1.4 KiB
C++
#ifndef BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_
|
|
#define BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_
|
|
|
|
#include <fsfw/action/HasActionsIF.h>
|
|
#include <fsfw/objectmanager/SystemObject.h>
|
|
#include <fsfw/tasks/ExecutableObjectIF.h>
|
|
#include <libxiphos.h>
|
|
|
|
class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public HasActionsIF {
|
|
public:
|
|
enum ActionId { ENABLE = 0, DISABLE = 1 };
|
|
|
|
XiphosWdtHandler(object_id_t objectId);
|
|
ReturnValue_t performOperation(uint8_t opCode) override;
|
|
ReturnValue_t initialize() override;
|
|
|
|
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
|
const uint8_t* data, size_t size) override;
|
|
[[nodiscard]] virtual MessageQueueId_t getCommandQueue() const override;
|
|
|
|
private:
|
|
// Wrappers to ensure idempotency of trash C API.
|
|
ReturnValue_t enableWdt();
|
|
ReturnValue_t disableWdt();
|
|
// Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API
|
|
// expects an int, so I guess this translates to 1 to 171 seconds.
|
|
// WARNING: DO NOT SET THIS HIGHER THAN 80 SECONDS!
|
|
// Possible bug in Xiphos/Xilinx kernel driver for watchdog, related to overflow.
|
|
int timeoutSeconds = 80;
|
|
bool enabled = false;
|
|
struct watchdog_s* wdtHandle = nullptr;
|
|
MessageQueueIF* requestQueue = nullptr;
|
|
ActionHelper actionHelper;
|
|
};
|
|
|
|
#endif /* BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_ */
|