Revision 234
RTC functional to retrieve date and time
proj.c | ||
---|---|---|
11 | 11 |
#include "keyboard.h" |
12 | 12 |
#include "mouse.h" |
13 | 13 |
#include "graph.h" |
14 |
#include "rtc.h" |
|
14 | 15 |
#include "interrupts_func.h" |
15 | 16 |
|
16 | 17 |
#include "graph.h" |
... | ... | |
84 | 85 |
} |
85 | 86 |
|
86 | 87 |
#ifdef DIOGO |
88 |
/* |
|
87 | 89 |
graph_clear_screen(); |
88 | 90 |
|
89 | 91 |
rectangle_t *rect = rectangle_ctor(0,0,400,100); |
... | ... | |
132 | 134 |
if(list_dtor(l)) printf("COULD NOT DESTRUCT LIST\n"); |
133 | 135 |
|
134 | 136 |
|
135 |
tickdelay(micros_to_ticks(1000000)); |
|
137 |
tickdelay(micros_to_ticks(1000000));*/
|
|
136 | 138 |
|
139 |
// RTC |
|
140 |
uint8_t date[4], time[3]; |
|
141 |
|
|
142 |
if (rtc_read_time(time)) return 1; |
|
143 |
|
|
144 |
if (rtc_read_date(date)) return 1; |
|
145 |
|
|
146 |
printf("Hour: %02d:%02d:%02d\n", time[2], time[1], time[0]); |
|
147 |
|
|
148 |
printf("Date: %d, %02d/%02d/%02d\n", date[0], date[1], date[2], date[3]); |
|
137 | 149 |
#endif |
138 | 150 |
|
139 | 151 |
#ifdef TELMO |
Also available in: Unified diff