Remove unnecessary MP_WEAK declarations

This commit is contained in:
Nick Moore 2019-04-02 13:23:55 +11:00
parent 92095eb666
commit 781d301bb6
4 changed files with 16 additions and 18 deletions

View File

@ -79,3 +79,12 @@ void common_hal_rtc_set_time(timeutils_struct_time_t *tm) {
); );
nrfx_rtc_counter_clear(&rtc_instance); 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"));
}

View File

@ -28,5 +28,6 @@
#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
extern void rtc_init(void); extern void rtc_init(void);
extern void rtc_reset(void);
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H

View File

@ -74,7 +74,10 @@ safe_mode_t port_init(void) {
// Configure millisecond timer initialization. // Configure millisecond timer initialization.
tick_init(); tick_init();
#if CIRCUITPY_RTC
rtc_init(); rtc_init();
#endif
// Will do usb_init() if chip supports USB. // Will do usb_init() if chip supports USB.
board_init(); board_init();
@ -94,7 +97,10 @@ void reset_port(void) {
pulseout_reset(); pulseout_reset();
pulsein_reset(); pulsein_reset();
timers_reset(); timers_reset();
#if CIRCUITPY_RTC
rtc_reset(); rtc_reset();
#endif
bleio_reset(); bleio_reset();

View File

@ -36,24 +36,6 @@
#include "shared-bindings/time/__init__.h" #include "shared-bindings/time/__init__.h"
#include "supervisor/shared/translate.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}}; const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}};
//| .. currentmodule:: rtc //| .. currentmodule:: rtc