File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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) {
7979 );
8080 nrfx_rtc_counter_clear (& rtc_instance );
8181}
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 2828#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
2929
3030extern void rtc_init (void );
31+ extern void rtc_reset (void );
3132
3233#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) {
7474
7575 // Configure millisecond timer initialization.
7676 tick_init ();
77+
78+ #if CIRCUITPY_RTC
7779 rtc_init ();
80+ #endif
7881
7982 // Will do usb_init() if chip supports USB.
8083 board_init ();
@@ -94,7 +97,10 @@ void reset_port(void) {
9497 pulseout_reset ();
9598 pulsein_reset ();
9699 timers_reset ();
100+
101+ #if CIRCUITPY_RTC
97102 rtc_reset ();
103+ #endif
98104
99105 bleio_reset ();
100106
Original file line number Diff line number Diff line change 3636#include "shared-bindings/time/__init__.h"
3737#include "supervisor/shared/translate.h"
3838
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-
5739const rtc_rtc_obj_t rtc_rtc_obj = {{& rtc_rtc_type }};
5840
5941//| .. currentmodule:: rtc
You can’t perform that action at this time.
0 commit comments