mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
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>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user