ESP32_ChinaDieselHeater_Con.../Arduino/BTCDieselHeater/Clock.h
2018-12-09 09:55:55 +11:00

30 lines
584 B
C++

#ifndef __BTC_TIMERS_H__
#define __BTC_TIMERS_H__
#include "BTCDateTime.h"
/*const BTCDateTime& getCurrentTime();
void setCurrentTime(const DateTime& newDateTime);
void initClock();
void checkClock();*/
class CClock {
RTC_DS3231& _rtc;
unsigned long _nextRTCfetch;
BTCDateTime _currentTime;
void _checkTimers();
void _checkTimer(int timer, const DateTime& now);
public:
CClock(RTC_DS3231& rtc);
void begin();
const BTCDateTime& update();
const BTCDateTime& get() const;
void set(const DateTime& newTime);
};
extern CClock Clock;
#endif // __BTC_TIMERS_H__