Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit781d301

Browse files
committed
Remove unnecessary MP_WEAK declarations
1 parent92095eb commit781d301

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+
intcommon_hal_rtc_get_calibration(void) {
84+
return0;
85+
}
86+
87+
voidcommon_hal_rtc_set_calibration(intcalibration) {
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
#defineMICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
2929

3030
externvoidrtc_init(void);
31+
externvoidrtc_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+
#ifCIRCUITPY_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+
#ifCIRCUITPY_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
constrtc_rtc_obj_trtc_rtc_obj= {{&rtc_rtc_type}};
5840

5941
//| .. currentmodule:: rtc

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp