Skip to content

Commit 46fdf28

Browse files
author
intustab
committed
added sys.devversion to track development changes between releases. switched by Makefile macro definition MP_DEV_VERSION
1 parent 80b7674 commit 46fdf28

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ports/esp32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/app_trace/include
8686
CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM
8787
CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP)
8888
CFLAGS += -DIDF_VER=\"$(IDF_VER)\"
89+
CFLAGS += -DMP_DEV_VERSION=\"fms\(machine.SLEEP\)\"
8990
CFLAGS += $(CFLAGS_MOD)
9091

9192
# this is what ESPIDF uses for c++ compilation

py/modsys.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) {
102102
}
103103
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit);
104104

105+
#ifdef MP_DEV_VERSION
106+
STATIC const MP_DEFINE_STR_OBJ(dev_version_obj, MP_DEV_VERSION);
107+
#endif
108+
105109
STATIC mp_obj_t mp_sys_print_exception(size_t n_args, const mp_obj_t *args) {
106110
#if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES
107111
void *stream_obj = &mp_sys_stdout_obj;
@@ -161,6 +165,9 @@ STATIC const mp_rom_map_elem_t mp_module_sys_globals_table[] = {
161165
#else
162166
{ MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_QSTR(MP_QSTR_big) },
163167
#endif
168+
#ifdef MP_DEV_VERSION
169+
{ MP_ROM_QSTR(MP_QSTR_devversion), MP_ROM_PTR(&dev_version_obj) },
170+
#endif
164171

165172
#if MICROPY_PY_SYS_MAXSIZE
166173
#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy