We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f0965b1 + 16bfe3b commit 15e97f1Copy full SHA for 15e97f1
ports/raspberrypi/common-hal/rtc/RTC.c
@@ -29,9 +29,23 @@
29
30
#include "py/runtime.h"
31
#include "src/rp2_common/hardware_rtc/include/hardware/rtc.h"
32
+#include "src/rp2_common/hardware_clocks/include/hardware/clocks.h"
33
34
void common_hal_rtc_init(void) {
35
+ datetime_t t = {
36
+ .year = 2020,
37
+ .month = 1,
38
+ .day = 1,
39
+ .dotw = 3, // 0 is Sunday, so 3 is Wednesday
40
+ .hour = 0,
41
+ .min = 0,
42
+ .sec = 0
43
+ };
44
+
45
+ // Start the RTC
46
rtc_init();
47
+ rtc_set_datetime(&t);
48
49
}
50
51
void common_hal_rtc_get_time(timeutils_struct_time_t *tm) {
0 commit comments