From 781d301bb6da7386bb735fc23637e4127b080072 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Tue, 2 Apr 2019 13:23:55 +1100 Subject: [PATCH] Remove unnecessary MP_WEAK declarations --- ports/nrf/common-hal/rtc/RTC.c | 9 +++++++++ ports/nrf/common-hal/rtc/RTC.h | 1 + ports/nrf/supervisor/port.c | 6 ++++++ shared-bindings/rtc/RTC.c | 18 ------------------ 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 25c1003ed9..57138350c9 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -79,3 +79,12 @@ void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { ); nrfx_rtc_counter_clear(&rtc_instance); } + +int common_hal_rtc_get_calibration(void) { + return 0; +} + +void common_hal_rtc_set_calibration(int calibration) { + mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); +} + diff --git a/ports/nrf/common-hal/rtc/RTC.h b/ports/nrf/common-hal/rtc/RTC.h index 5374fa2c86..0207c8338c 100644 --- a/ports/nrf/common-hal/rtc/RTC.h +++ b/ports/nrf/common-hal/rtc/RTC.h @@ -28,5 +28,6 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H extern void rtc_init(void); +extern void rtc_reset(void); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 3d20e94aea..85ecd6afe5 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -74,7 +74,10 @@ safe_mode_t port_init(void) { // Configure millisecond timer initialization. tick_init(); + + #if CIRCUITPY_RTC rtc_init(); + #endif // Will do usb_init() if chip supports USB. board_init(); @@ -94,7 +97,10 @@ void reset_port(void) { pulseout_reset(); pulsein_reset(); timers_reset(); + + #if CIRCUITPY_RTC rtc_reset(); + #endif bleio_reset(); diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 97265d601a..17dccdb03c 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -36,24 +36,6 @@ #include "shared-bindings/time/__init__.h" #include "supervisor/shared/translate.h" -/* -void MP_WEAK common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - mp_raise_NotImplementedError(translate("RTC is not supported on this board")); -} - -void MP_WEAK common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - mp_raise_NotImplementedError(translate("RTC is not supported on this board")); -} - -int MP_WEAK common_hal_rtc_get_calibration(void) { - return 0; -} - -void MP_WEAK common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); -} -*/ - const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; //| .. currentmodule:: rtc