From 15b59bee1b04323365da58338a6a70f9dd51fc79 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 4 Oct 2018 22:31:47 +1000 Subject: change initialization method + mod_network names --- main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1e07b2d07..f1c68d06a 100755 --- a/main.c +++ b/main.c @@ -54,6 +54,10 @@ #include "supervisor/shared/stack.h" #include "supervisor/serial.h" +#ifdef MICROPY_PY_NETWORK +#include "shared-bindings/network/__init__.h" +#endif + void do_str(const char *src, mp_parse_input_kind_t input_kind) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); if (lex == NULL) { @@ -108,10 +112,16 @@ void start_mp(supervisor_allocation* heap) { mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_FROZEN_FAKE_DIR_QSTR)); mp_obj_list_init(mp_sys_argv, 0); + + #if MICROPY_PY_NETWORK + network_module_init(); + #endif } void stop_mp(void) { - + #if MICROPY_PY_NETWORK + network_module_deinit(); + #endif } #define STRING_LIST(...) {__VA_ARGS__, ""} -- cgit v1.2.3