This commit is contained in:
parent
1b843ce4b4
commit
90c66be515
19 changed files with 413 additions and 162 deletions
31
src/WatchFeatures/RTC.h
Normal file
31
src/WatchFeatures/RTC.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#ifndef WATCHY_RTC_H
|
||||
#define WATCHY_RTC_H
|
||||
|
||||
#include "config.h"
|
||||
#include <Arduino.h>
|
||||
#include <TimeLib.h>
|
||||
#include <Rtc_Pcf8563.h>
|
||||
|
||||
namespace WatchFeatures
|
||||
{
|
||||
class RTC;
|
||||
}
|
||||
|
||||
class WatchFeatures::RTC {
|
||||
public:
|
||||
Rtc_Pcf8563 rtc_pcf;
|
||||
|
||||
public:
|
||||
void Get(tmElements_t & tm);
|
||||
void Set(tmElements_t tm);
|
||||
void SetTimer();
|
||||
bool CheckWakeup(); // Checks to really wake up or not, also resets the timer after the initial sleep
|
||||
void Resync(); // Resync the timer cycle, both initially and after RTC resync
|
||||
|
||||
static void OffsetTime(tmElements_t & tm, int offsetInSeconds);
|
||||
|
||||
private:
|
||||
static RTC_DATA_ATTR bool m_timerSet, m_initialTimer;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue