ESP32_ChinaDieselHeater_Con.../Arduino/BTCDieselHeater/Clock.h

31 lines
584 B
C
Raw Normal View History

2018-12-08 22:55:55 +00:00
#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__