forked from bxparks/AceTime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.cpp
More file actions
29 lines (23 loc) · 836 Bytes
/
Controller.cpp
File metadata and controls
29 lines (23 loc) · 836 Bytes
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
#include "Controller.h"
void Controller::setup() {
// Restore from EEPROM to other settings
StoredInfo storedInfo;
bool isValid = mCrcEeprom.readWithCrc(kStoredInfoEepromAddress,
&storedInfo, sizeof(StoredInfo));
if (isValid) {
mClockInfo0.hourMode = storedInfo.hourMode;
mClockInfo0.blinkingColon = storedInfo.blinkingColon;
mClockInfo1.hourMode = storedInfo.hourMode;
mClockInfo1.blinkingColon = storedInfo.blinkingColon;
mClockInfo2.hourMode = storedInfo.hourMode;
mClockInfo2.blinkingColon = storedInfo.blinkingColon;
#if TIME_ZONE_TYPE == TIME_ZONE_TYPE_MANUAL
mClockInfo0.timeZone.setDst(storedInfo.isDst0);
mClockInfo1.timeZone.setDst(storedInfo.isDst1);
mClockInfo2.timeZone.setDst(storedInfo.isDst2);
#endif
} else {
preserveInfo();
}
mMode = MODE_DATE_TIME;
}