feature: Add SPIT-Source as is

This commit is contained in:
2024-08-19 03:29:37 +02:00
parent a5805aceb2
commit 500641a6e2
31 changed files with 10176 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Watchdog.h
* Author: Hagi
*
* Created on 22. April 2019, 13:02
*/
#ifndef WATCHDOG_H
#define WATCHDOG_H
#include "_SPITMACROS.h"
#include <mutex>
#include <condition_variable>
#include <thread>
using namespace std;
class Watchdog {
public:
class Listener {
public:
virtual void sendWatchdog()=0;
virtual void eventWatchdogLost()=0;
};
static int WATCHDOGTIME;
static bool s_StopWatchdog;
Watchdog(Listener* p_Listener);
virtual ~Watchdog();
private:
Listener* m_Listener;
mutex m_MutexLock;
condition_variable m_ConditionVariable;
thread* m_WatchdogThread;
bool m_Answered;
void runWatchdog();
public:
void startWatchdog();
void answerWatchdog();
void stopWatchdog();
};
#endif /* WATCHDOG_H */