WIP refactoring
Some checks failed
Compile / Compile (push) Failing after 1m5s

This commit is contained in:
Lewis Jackson 2023-06-01 03:07:52 +03:00
parent 1b843ce4b4
commit 90c66be515
19 changed files with 413 additions and 162 deletions

31
src/WatchFeatures/RTC.h Normal file
View 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