Files
Arduino/WeatherPredictor/rtc_time.h
T
oskarvitaliiandClaude Opus 4.8 ea0256a5b9 feat: NTP time sync writing to DS3231 (by IP, DNS-independent)
This LAN's router does not resolve external hostnames, so NTP uses
hard-coded Cloudflare/Google anycast IPs instead of names.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 21:05:29 +07:00

15 lines
310 B
C

#pragma once
#include <Arduino.h>
struct RtcTime {
uint16_t year;
uint8_t month, day, hour, minute, second;
};
bool rtcBegin();
bool rtcLostPower();
RtcTime rtcNow();
void rtcSet(const RtcTime& t);
uint32_t rtcEpoch();
bool ntpSync(int tzOffsetMin); // true if synced and RTC updated