File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,10 +85,6 @@ INC += -I../lib/mp-readline
8585CFLAGS_MOD += -DMICROPY_USE_READLINE=1
8686LIB_SRC_C_EXTRA += mp-readline/readline.c
8787endif
88- ifeq ($(MICROPY_PY_TIME ) ,1)
89- CFLAGS_MOD += -DMICROPY_PY_TIME=1
90- SRC_MOD += modtime.c
91- endif
9288ifeq ($(MICROPY_PY_TERMIOS ) ,1)
9389CFLAGS_MOD += -DMICROPY_PY_TERMIOS=1
9490SRC_MOD += modtermios.c
@@ -136,6 +132,7 @@ SRC_C = \
136132 file.c \
137133 modmachine.c \
138134 modos.c \
135+ modtime.c \
139136 moduselect.c \
140137 alloc.c \
141138 coverage.c \
@@ -234,7 +231,7 @@ fast:
234231
235232# build a minimal interpreter
236233minimal :
237- $(MAKE ) COPT=" -Os -DNDEBUG" CFLAGS_EXTRA=' -DMP_CONFIGFILE="<mpconfigport_minimal.h>"' BUILD=build-minimal PROG=micropython_minimal MICROPY_PY_TIME=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_SOCKET=0 MICROPY_PY_FFI=0 MICROPY_USE_READLINE=0 MICROPY_FATFS=0
234+ $(MAKE ) COPT=" -Os -DNDEBUG" CFLAGS_EXTRA=' -DMP_CONFIGFILE="<mpconfigport_minimal.h>"' BUILD=build-minimal PROG=micropython_minimal MICROPY_PY_TERMIOS=0 MICROPY_PY_SOCKET=0 MICROPY_PY_FFI=0 MICROPY_USE_READLINE=0 MICROPY_FATFS=0
238235
239236# build interpreter with nan-boxing as object model
240237nanbox :
Original file line number Diff line number Diff line change 2424 * THE SOFTWARE.
2525 */
2626
27+ #include "py/mpconfig.h"
28+ #if MICROPY_PY_UTIME
29+
2730#include <unistd.h>
2831#include <errno.h>
2932#include <string.h>
@@ -190,3 +193,5 @@ const mp_obj_module_t mp_module_time = {
190193 .name = MP_QSTR_utime ,
191194 .globals = (mp_obj_dict_t * )& mp_module_time_globals ,
192195};
196+
197+ #endif // MICROPY_PY_UTIME
Original file line number Diff line number Diff line change 103103#define MICROPY_STACKLESS_STRICT (0)
104104
105105#define MICROPY_PY_OS_STATVFS (1)
106+ #define MICROPY_PY_UTIME (1)
106107#define MICROPY_PY_UERRNO (1)
107108#define MICROPY_PY_UCTYPES (1)
108109#define MICROPY_PY_UZLIB (1)
@@ -170,10 +171,10 @@ extern const struct _mp_obj_module_t mp_module_jni;
170171#else
171172#define MICROPY_PY_JNI_DEF
172173#endif
173- #if MICROPY_PY_TIME
174- #define MICROPY_PY_TIME_DEF { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_time) },
174+ #if MICROPY_PY_UTIME
175+ #define MICROPY_PY_UTIME_DEF { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_time) },
175176#else
176- #define MICROPY_PY_TIME_DEF
177+ #define MICROPY_PY_UTIME_DEF
177178#endif
178179#if MICROPY_PY_TERMIOS
179180#define MICROPY_PY_TERMIOS_DEF { MP_ROM_QSTR(MP_QSTR_termios), MP_ROM_PTR(&mp_module_termios) },
@@ -194,7 +195,7 @@ extern const struct _mp_obj_module_t mp_module_jni;
194195#define MICROPY_PORT_BUILTIN_MODULES \
195196 MICROPY_PY_FFI_DEF \
196197 MICROPY_PY_JNI_DEF \
197- MICROPY_PY_TIME_DEF \
198+ MICROPY_PY_UTIME_DEF \
198199 MICROPY_PY_SOCKET_DEF \
199200 { MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
200201 { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) }, \
Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ MICROPY_USE_READLINE = 1
1111# Whether to enable FatFs VFS
1212MICROPY_FATFS = 1
1313
14- # Subset of CPython time module
15- MICROPY_PY_TIME = 1
16-
1714# Subset of CPython termios module
1815MICROPY_PY_TERMIOS = 1
1916
Original file line number Diff line number Diff line change 7777#define MICROPY_PY_SYS_STDFILES (0)
7878#define MICROPY_PY_CMATH (0)
7979#define MICROPY_PY_UCTYPES (0)
80+ #define MICROPY_PY_UTIME (0)
8081#define MICROPY_PY_UZLIB (0)
8182#define MICROPY_PY_UJSON (0)
8283#define MICROPY_PY_URE (0)
You can’t perform that action at this time.
0 commit comments