10000 mimxrt/machine_rtc: Drop machine.RTC.now() method. · 32bitmicro/micropython@0302cd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0302cd6

Browse files
robert-hhdpgeorge
authored andcommitted
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>
1 parent b5de529 commit 0302cd6

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

docs/library/machine.RTC.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Methods
4848

4949
Get get the current datetime tuple.
5050

51+
Availability: WiPy.
52+
5153
.. method:: RTC.deinit()
5254

5355
Resets the RTC to the time of January 1, 2015 and starts running it again.

ports/mimxrt/machine_rtc.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -230,25 +230,6 @@ static mp_obj_t machine_rtc_datetime(mp_uint_t n_args, const mp_obj_t *args) {
230230
}
231231
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_rtc_datetime_obj, 1, 2, machine_rtc_datetime);
232232

233-
static mp_obj_t machine_rtc_now(mp_obj_t self_in) {
234-
// Get date and time in CPython order.
235-
snvs_lp_srtc_datetime_t srtc_date;
236-
SNVS_LP_SRTC_GetDatetime(SNVS, &srtc_date);
237-
238-
mp_obj_t tuple[8] = {
239-
mp_obj_new_int(srtc_date.year),
240-
mp_obj_new_int(srtc_date.month),
241-
mp_obj_new_int(srtc_date.day),
242-
mp_obj_new_int(srtc_date.hour),
243-
mp_obj_new_int(srtc_date.minute),
244-
mp_obj_new_int(srtc_date.second),
245-
mp_obj_new_int(0),
246-
mp_const_none,
247-
};
248-
return mp_obj_new_tuple(8, tuple);
249-
}
250-
static MP_DEFINE_CONST_FUN_OBJ_1(machine_rtc_now_obj, machine_rtc_now);
251-
252233
static mp_obj_t machine_rtc_init(mp_obj_t self_in, mp_obj_t date) {
253234
mp_obj_t args[2] = {self_in, date};
254235
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);
389370
static const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = {
390371
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_rtc_init_obj) },
391372
{ MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&machine_rtc_datetime_obj) },
392-
{ MP_ROM_QSTR(MP_QSTR_now), MP_ROM_PTR(&machine_rtc_now_obj) },
393373
{ MP_ROM_QSTR(MP_QSTR_calibration), MP_ROM_PTR(&machine_rtc_calibration_obj) },
394374
{ MP_ROM_QSTR(MP_QSTR_alarm), MP_ROM_PTR(&machine_rtc_alarm_obj) },
395375
{ MP_ROM_QSTR(MP_QSTR_alarm_left), MP_ROM_PTR(&machine_rtc_alarm_left_obj) },

0 commit comments

Comments
 (0)
0