diff --git a/ports/wch/Makefile b/ports/wch/Makefile index abc34d5e4a037..a11d61535073d 100644 --- a/ports/wch/Makefile +++ b/ports/wch/Makefile @@ -44,7 +44,7 @@ SRC_C = \ shared/runtime/gchelper_generic.c \ shared/runtime/pyexec.c \ shared/runtime/stdout_helpers.c \ - extmod/modutime.c + extmod/modtime.c SRC_C += $(wildcard $(SRC_DIR)*.c) @@ -53,7 +53,7 @@ SRC_S += bsp/startup_ch32v30x_D8C.S SRC_C += $(SRC_MOD) SRC_CXX += $(SRC_MOD_CXX) SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) -SRC_QSTR += pin.c pin_named_pins.c modmachine.c modutime.c +SRC_QSTR += pin.c pin_named_pins.c modmachine.c modtime.c SRC_QSTR += shared/readline/readline.c shared/runtime/pyexec.c SRC_C += $(BUILD)/pins_$(BOARD).c diff --git a/ports/wch/modutime.c b/ports/wch/modtime.c similarity index 94% rename from ports/wch/modutime.c rename to ports/wch/modtime.c index 8191f494387ff..b523e0fe81e67 100644 --- a/ports/wch/modutime.c +++ b/ports/wch/modtime.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2013-2023 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ #include "shared/timeutils/timeutils.h" // Return the localtime as an 8-tuple. -STATIC mp_obj_t mp_utime_localtime_get(void) { +STATIC mp_obj_t mp_time_localtime_get(void) { // get current date and time // note: need to call get time then get date to correctly access the registers rtc_init_finalise(); @@ -50,7 +50,7 @@ STATIC mp_obj_t mp_utime_localtime_get(void) { } // Returns the number of seconds, as an integer, since 1/1/2000. -STATIC mp_obj_t mp_utime_time_get(void) { +STATIC mp_obj_t mp_time_time_get(void) { // get date and time // note: need to call get time then get date to correctly access the registers rtc_init_finalise(); diff --git a/ports/wch/mpconfigport.h b/ports/wch/mpconfigport.h index 95cab5a673ea8..c34bc11220ddc 100644 --- a/ports/wch/mpconfigport.h +++ b/ports/wch/mpconfigport.h @@ -30,7 +30,9 @@ #define MICROPY_PY_STRUCT (1) #define MICROPY_PY_MODTIME (1) -#define MICROPY_PY_UTIME_MP_HAL (1) +#define MICROPY_PY_UTIME_GMTIME_LOCALTIME_MKTIME (1) +#define MICROPY_PY_UTIME_TIME_TIME_NS (1) +#define MICROPY_PY_UTIME_INCLUDEFILE "ports/wch/modutime.c" #define MICROPY_PY_MODMACHINE (1)