-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeGestion.ino
46 lines (39 loc) · 1.11 KB
/
TimeGestion.ino
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
36
37
38
39
40
41
42
43
44
45
46
// RTC Functions
// Call back for file timestamps. Only called for file create and sync().
void dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10) {
// Return date using FS_DATE macro to format fields.
*date = FS_DATE(year(), month(), day());
// Return time using FS_TIME macro to format fields.
*time = FS_TIME(hour(), minute(), second());
// Return low time bits in units of 10 ms.
*ms10 = second() & 1 ? 100 : 0;
}
void printDigits(int digits){
// utility function for digital clock display: prints preceding colon and leading 0
display.print(":");
if(digits < 10)
display.print('0');
display.print(digits);
}
void digitalClockDisplay() {
// digital clock display of the time
display.print(hour());
printDigits(minute());
printDigits(second());
display.print(" ");
display.print(day());
display.print(" ");
display.print(month());
display.print(" ");
display.print(year());
}
void digitalTimeDisplay() {
// digital clock display of the time
display.print(hour());
printDigits(minute());
printDigits(second());
}
time_t getTeensy3Time()
{
return Teensy3Clock.get();
}