FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SecureGen/include/rtc_manager.h at master · makepkg/SecureGen · GitHub
makepkg
/
SecureGen
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
14
Star
91
Code
Issues
2
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SecureGen
/
include
/
rtc_manager.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (30 loc) · 724 Bytes
Breadcrumbs
SecureGen
/
include
/
rtc_manager.h
Copy path
File metadata and controls
35 lines (30 loc) · 724 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
pragma
once
#
include
<
Arduino.h
>
#
include
<
ArduinoJson.h
>
#
include
<
LittleFS.h
>
#
include
<
RTClib.h
>
#
include
<
Wire.h
>
static
constexpr
int
RTC_BOOT_COMPENSATION_SEC
=
0
;
struct
RTCConfig
{
bool
enabled =
false
;
int
sda_pin =
21
;
int
scl_pin =
22
;
};
class
RTCManager
{
public:
bool
loadConfig
();
bool
saveConfig
(
const
RTCConfig &cfg);
bool
init
();
bool
reinit
();
bool
syncFromRTC
();
bool
syncToRTC
(
time_t
t);
bool
isAvailable
()
const
{
return
_available; }
bool
isInitialized
()
const
{
return
_initialized; }
RTCConfig
getConfig
()
const
{
return
_config; }
DateTime
getCurrentTime
();
private:
RTC_DS3231
_rtc;
RTCConfig _config;
bool
_initialized =
false
;
bool
_available =
false
;
};
Back
|
FazBrowse Home
|
New Git URL