diff options
author | robert-hh <robert@hammelrath.com> | 2023-01-28 14:57:22 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-12-19 16:00:41 +1100 |
commit | 0302cd65e85cb255670cf6eb32d9e6cee241128c (patch) | |
tree | 789ebf0f8acb7dff3cb3b1e240a52c41bcfde643 | |
parent | b5de529ffc17dd02e24c3f2b14e230eefe42dc7a (diff) |
mimxrt/machine_rtc: Drop machine.RTC.now() method.
This is not part of the common machine API. It's dropped on the mimxrt
port and kept only on the cc3200 port for legacy.
Also show the port availability of `RTC.now()` in the documentation.
Signed-off-by: robert-hh <robert@hammelrath.com>
-rw-r--r-- | docs/library/machine.RTC.rst | 2 | ||||
-rw-r--r-- | ports/mimxrt/machine_rtc.c | 20 |
2 files changed, 2 insertions, 20 deletions
diff --git a/docs/library/machine.RTC.rst b/docs/library/machine.RTC.rst index a45718903..ed93c5fff 100644 --- a/docs/library/machine.RTC.rst +++ b/docs/library/machine.RTC.rst @@ -48,6 +48,8 @@ Methods Get get the current datetime tuple. + Availability: WiPy. + .. method:: RTC.deinit() Resets the RTC to the time of January 1, 2015 and starts running it again. diff --git a/ports/mimxrt/machine_rtc.c b/ports/mimxrt/machine_rtc.c index 0d6fc54c8..91769ea33 100644 --- a/ports/mimxrt/machine_rtc.c +++ b/ports/mimxrt/machine_rtc.c @@ -230,25 +230,6 @@ static mp_obj_t machine_rtc_datetime(mp_uint_t n_args, const mp_obj_t *args) { } static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_rtc_datetime_obj, 1, 2, machine_rtc_datetime); -static mp_obj_t machine_rtc_now(mp_obj_t self_in) { - // Get date and time in CPython order. - snvs_lp_srtc_datetime_t srtc_date; - SNVS_LP_SRTC_GetDatetime(SNVS, &srtc_date); - - mp_obj_t tuple[8] = { - mp_obj_new_int(srtc_date.year), - mp_obj_new_int(srtc_date.month), - mp_obj_new_int(srtc_date.day), - mp_obj_new_int(srtc_date.hour), - mp_obj_new_int(srtc_date.minute), - mp_obj_new_int(srtc_date.second), - mp_obj_new_int(0), - mp_const_none, - }; - return mp_obj_new_tuple(8, tuple); -} -static MP_DEFINE_CONST_FUN_OBJ_1(machine_rtc_now_obj, machine_rtc_now); - static mp_obj_t machine_rtc_init(mp_obj_t self_in, mp_obj_t date) { mp_obj_t args[2] = {self_in, date}; machine_rtc_datetime_helper(2, args); @@ -389,7 +370,6 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(machine_rtc_irq_obj, 1, machine_rtc_irq); static const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_rtc_init_obj) }, { MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&machine_rtc_datetime_obj) }, - { MP_ROM_QSTR(MP_QSTR_now), MP_ROM_PTR(&machine_rtc_now_obj) }, { MP_ROM_QSTR(MP_QSTR_calibration), MP_ROM_PTR(&machine_rtc_calibration_obj) }, { MP_ROM_QSTR(MP_QSTR_alarm), MP_ROM_PTR(&machine_rtc_alarm_obj) }, { MP_ROM_QSTR(MP_QSTR_alarm_left), MP_ROM_PTR(&machine_rtc_alarm_left_obj) }, |