add support for hardware rtc, not sure if this version won't crash

This commit is contained in:
2026-01-11 12:04:40 +01:00
parent 06de03a16d
commit a4346aa4f1
22 changed files with 813 additions and 88 deletions

18
include/rtc.hpp Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include "constants.h"
#include <ESP32Time.h>
#include <RX8010SJ.h>
extern bool rtcset;
extern bool NTPupdated;
extern ESP32Time rtc;
extern bool rx_rtc_avail;
extern RX8010SJ::Adapter rx_rtc;
void timeToDateTime(time_t t, struct RX8010SJ::DateTime* dateTime);
time_t dateTimeToTime(const struct RX8010SJ::DateTime* dateTime);
void sync_to_rx_rtc(int32_t offset = 0);
void sync_from_rx_rtc(int32_t offset = 0);