8000 esp8266/modutime.c: remove symbol conflicts between time and utime mo… · godlygeek/circuitpython@56bf411 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56bf411

Browse files
committed
esp8266/modutime.c: remove symbol conflicts between time and utime modules
this renames symbols in modutime.c so that it no longer conflicts with the time module. This commit does not enable the utime module; it simply makes it easier for a local developer to do so.
1 parent bca5aec commit 56bf411

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ports/esp8266/modutime.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
7575
};
7676
return mp_obj_new_tuple(8, tuple);
7777
}
78-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime);
78+
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(utime_localtime_obj, 0, 1, time_localtime);
7979

8080
/// \function mktime()
8181
/// This is inverse function of localtime. It's argument is a full 8-tuple
@@ -95,21 +95,21 @@ STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
9595
mp_obj_get_int(elem[1]), mp_obj_get_int(elem[2]), mp_obj_get_int(elem[3]),
9696
mp_obj_get_int(elem[4]), mp_obj_get_int(elem[5])));
9797
}
98-
MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
98+
MP_DEFINE_CONST_FUN_OBJ_1(utime_mktime_obj, time_mktime);
9999

100100
/// \function time()
101101
/// Returns the number of seconds, as an integer, since 1/1/2000.
102102
STATIC mp_obj_t time_time(void) {
103103
// get date and time
104104
return mp_obj_new_int(pyb_rtc_get_us_since_2000() / 1000 / 1000);
105105
}
106-
MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time);
106+
MP_DEFINE_CONST_FUN_OBJ_0(utime_time_obj, time_time);
107107

108108
STATIC const mp_rom_map_elem_t time_module_globals_table[] = {
109109
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_utime) },
110110

111-
{ MP_ROM_QSTR(MP_QSTR_localtime), MP_ROM_PTR(&time_localtime_obj) },
112-
{ MP_ROM_QSTR(MP_QSTR_mktime), MP_ROM_PTR(&time_mktime_obj) },
111+
{ MP_ROM_QSTR(MP_QSTR_localtime), MP_ROM_PTR(&utime_localtime_obj) },
112+
{ MP_ROM_QSTR(MP_QSTR_mktime), MP_ROM_PTR(&utime_mktime_obj) },
113113
{ MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&mp_utime_sleep_obj) },
114114
{ MP_ROM_QSTR(MP_QSTR_sleep_ms), MP_ROM_PTR(&mp_utime_sleep_ms_obj) },
115115
{ MP_ROM_QSTR(MP_QSTR_sleep_us), MP_ROM_PTR(&mp_utime_sleep_us_obj) },
@@ -118,7 +118,7 @@ STATIC const mp_rom_map_elem_t time_module_globals_table[] = {
118118
{ MP_ROM_QSTR(MP_QSTR_ticks_cpu), MP_ROM_PTR(&mp_utime_ticks_cpu_obj) },
119119
{ MP_ROM_QSTR(MP_QSTR_ticks_add), MP_ROM_PTR(&mp_utime_ticks_add_obj) },
120120
{ MP_ROM_QSTR(MP_QSTR_ticks_diff), MP_ROM_PTR(&mp_utime_ticks_diff_obj) },
121-
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_time_obj) },
121+
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&utime_time_obj) },
122122
};
123123

124124
STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);

0 commit comments

Comments
 (0)
0