summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-03-10 12:16:00 +1100
committerDamien George <damien@micropython.org>2023-04-27 15:09:56 +1000
commit995555300181b3385855f5a4ffb629441553d3ea (patch)
tree2498f5867d0fd279ca3e9453db673118794f838c /py
parent083dc1f08296adc8fa80cbc13a18df8cdd526824 (diff)
extmod/modutime: Provide a generic time module.
Based on extmod/utime_mphal.c, with: - a globals dict added - time.localtime wrapper added - time.time wrapper added - time.time_ns function added New configuration options are added for this module: - MICROPY_PY_UTIME (enabled at basic features level) - MICROPY_PY_UTIME_GMTIME_LOCALTIME_MKTIME - MICROPY_PY_UTIME_TIME_TIME_NS Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r--py/mpconfig.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 7829cc126..89fb733e9 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1468,10 +1468,19 @@ typedef double mp_float_t;
#define MICROPY_PY_USELECT_SELECT (1)
#endif
-// Whether to provide "utime" module functions implementation
-// in terms of mp_hal_* functions.
-#ifndef MICROPY_PY_UTIME_MP_HAL
-#define MICROPY_PY_UTIME_MP_HAL (0)
+// Whether to provide the "utime" module
+#ifndef MICROPY_PY_UTIME
+#define MICROPY_PY_UTIME (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_BASIC_FEATURES)
+#endif
+
+// Whether to provide utime.gmtime/localtime/mktime functions
+#ifndef MICROPY_PY_UTIME_GMTIME_LOCALTIME_MKTIME
+#define MICROPY_PY_UTIME_GMTIME_LOCALTIME_MKTIME (0)
+#endif
+
+// Whether to provide utime.time/time_ns functions
+#ifndef MICROPY_PY_UTIME_TIME_TIME_NS
+#define MICROPY_PY_UTIME_TIME_TIME_NS (0)
#endif
// Period of values returned by utime.ticks_ms(), ticks_us(), ticks_cpu()