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>
This commit is contained in:
robert-hh
2023-01-28 14:57:22 +01:00
committed by Damien George
parent b5de529ffc
commit 0302cd65e8
2 changed files with 2 additions and 20 deletions

View File

@@ -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.

View File

@@ -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) },