diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 1 | ||||
-rw-r--r-- | py/mpconfig.h | 4 | ||||
-rw-r--r-- | py/objmodule.c | 3 | ||||
-rw-r--r-- | py/py.mk | 6 | ||||
-rw-r--r-- | py/qstrdefs.h | 5 |
5 files changed, 19 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h index 829d34358b..20ff1f765f 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -101,6 +101,7 @@ extern const mp_obj_module_t mp_module_ure; extern const mp_obj_module_t mp_module_uheapq; extern const mp_obj_module_t mp_module_uhashlib; extern const mp_obj_module_t mp_module_ubinascii; +extern const mp_obj_module_t mp_module_ussl; extern const mp_obj_module_t mp_module_machine; #endif // __MICROPY_INCLUDED_PY_BUILTIN_H__ diff --git a/py/mpconfig.h b/py/mpconfig.h index 99bf47536d..4b986eef9a 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -682,6 +682,10 @@ typedef double mp_float_t; #define MICROPY_PY_MACHINE (0) #endif +#ifndef MICROPY_PY_USSL +#define MICROPY_PY_USSL (0) +#endif + /*****************************************************************************/ /* Hooks for a port to add builtins */ diff --git a/py/objmodule.c b/py/objmodule.c index e0fad37f0a..940a8daf25 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -186,6 +186,9 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_MACHINE { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, #endif +#if MICROPY_PY_USSL + { MP_OBJ_NEW_QSTR(MP_QSTR_ussl), (mp_obj_t)&mp_module_ussl }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES @@ -10,6 +10,11 @@ PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h # some code is performance bottleneck and compiled with other optimization options CSUPEROPT = -O3 +ifeq ($(MICROPY_PY_USSL),1) +CFLAGS_MOD += -DMICROPY_PY_USSL=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config +LDFLAGS_MOD += -L../lib/axtls/_stage -laxtls +endif + # py object files PY_O_BASENAME = \ mpstate.o \ @@ -119,6 +124,7 @@ PY_O_BASENAME = \ ../extmod/moduhashlib.o \ ../extmod/modubinascii.o \ ../extmod/modmachine.o \ + ../extmod/modussl.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 425b6ee107..e91c665c20 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -607,3 +607,8 @@ Q(mem8) Q(mem16) Q(mem32) #endif + +#if MICROPY_PY_USSL +Q(ussl) +Q(wrap_socket) +#endif |