diff options
| author | Nick Moore <nick@zoic.org> | 2019-04-02 13:23:55 +1100 |
|---|---|---|
| committer | Nick Moore <nick@zoic.org> | 2019-04-02 13:33:22 +1100 |
| commit | 781d301bb6da7386bb735fc23637e4127b080072 (patch) | |
| tree | 205d4c5856b2c4798f689484e4fa693ca7a7ec9e | |
| parent | 92095eb6664e1dc585b89557a33e19801f7c0375 (diff) | |
Remove unnecessary MP_WEAK declarations
| -rw-r--r-- | ports/nrf/common-hal/rtc/RTC.c | 9 | ||||
| -rw-r--r-- | ports/nrf/common-hal/rtc/RTC.h | 1 | ||||
| -rw-r--r-- | ports/nrf/supervisor/port.c | 6 | ||||
| -rw-r--r-- | 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 25c1003ed..57138350c 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 5374fa2c8..0207c8338 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 3d20e94ae..85ecd6afe 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 97265d601..17dccdb03 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 |
