34 lines
469 B
C++
34 lines
469 B
C++
/*
|
|
* Timer.hpp
|
|
*
|
|
* Created on: Jun 7, 2024
|
|
* Author: Carst
|
|
*/
|
|
|
|
#ifndef TIMER_HPP_
|
|
#define TIMER_HPP_
|
|
|
|
#include <cstdint>
|
|
|
|
namespace ElektronischeLast
|
|
{
|
|
class Timer
|
|
{
|
|
private:
|
|
uint32_t timer_start;
|
|
uint32_t timeout;
|
|
bool isRunning;
|
|
public:
|
|
Timer();
|
|
void start(uint32_t durationMs);
|
|
void stop(void);
|
|
bool elapsed(void);
|
|
void tick(void);
|
|
bool is_running(void);
|
|
};
|
|
}
|
|
|
|
|
|
|
|
#endif /* TIMER_HPP_ */
|