File tree 4 files changed +16
-18
lines changed
4 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -79,3 +79,12 @@ void common_hal_rtc_set_time(timeutils_struct_time_t *tm) {
79
79
);
80
80
nrfx_rtc_counter_clear (& rtc_instance );
81
81
}
82
+
83
+ int common_hal_rtc_get_calibration (void ) {
84
+ return 0 ;
85
+ }
86
+
87
+ void common_hal_rtc_set_calibration (int calibration ) {
88
+ mp_raise_NotImplementedError (translate ("RTC calibration is not supported on this board" ));
89
+ }
90
+
Original file line number Diff line number Diff line change 28
28
#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
29
29
30
30
extern void rtc_init (void );
31
+ extern void rtc_reset (void );
31
32
32
33
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ safe_mode_t port_init(void) {
74
74
75
75
// Configure millisecond timer initialization.
76
76
tick_init ();
77
+
78
+ #if CIRCUITPY_RTC
77
79
rtc_init ();
80
+ #endif
78
81
79
82
// Will do usb_init() if chip supports USB.
80
83
board_init ();
@@ -94,7 +97,10 @@ void reset_port(void) {
94
97
pulseout_reset ();
95
98
pulsein_reset ();
96
99
timers_reset ();
100
+
101
+ #if CIRCUITPY_RTC
97
102
rtc_reset ();
103
+ #endif
98
104
99
105
bleio_reset ();
100
106
Original file line number Diff line number Diff line change 36
36
#include "shared-bindings/time/__init__.h"
37
37
#include "supervisor/shared/translate.h"
38
38
39
- /*
40
- void MP_WEAK common_hal_rtc_get_time(timeutils_struct_time_t *tm) {
41
- mp_raise_NotImplementedError(translate("RTC is not supported on this board"));
42
- }
43
-
44
- void MP_WEAK common_hal_rtc_set_time(timeutils_struct_time_t *tm) {
45
- mp_raise_NotImplementedError(translate("RTC is not supported on this board"));
46
- }
47
-
48
- int MP_WEAK common_hal_rtc_get_calibration(void) {
49
- return 0;
50
- }
51
-
52
- void MP_WEAK common_hal_rtc_set_calibration(int calibration) {
53
- mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board"));
54
- }
55
- */
56
-
57
39
const rtc_rtc_obj_t rtc_rtc_obj = {{& rtc_rtc_type }};
58
40
59
41
//| .. currentmodule:: rtc
You can’t perform that action at this time.
0 commit comments