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:
Damien George
2023-03-10 12:16:00 +11:00
parent 083dc1f082
commit 9955553001
19 changed files with 141 additions and 38 deletions

View File

@@ -25,7 +25,7 @@
*/
#include "py/runtime.h"
#include "extmod/utime_mphal.h"
#include "extmod/modutime.h"
#include "shared/timeutils/timeutils.h"
#include "modmachine.h"