Skip to content

Commit 781d301

Browse files
committed
Remove unnecessary MP_WEAK declarations
1 parent 92095eb commit 781d301

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

ports/nrf/common-hal/rtc/RTC.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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+

ports/nrf/common-hal/rtc/RTC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
2929

3030
extern void rtc_init(void);
31+
extern void rtc_reset(void);
3132

3233
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H

ports/nrf/supervisor/port.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

shared-bindings/rtc/RTC.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@
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-
5739
const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}};
5840

5941
//| .. currentmodule:: rtc

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy