summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorNick Moore <nick@zoic.org>2018-10-04 22:31:47 +1000
committerNick Moore <nick@zoic.org>2018-10-04 22:31:47 +1000
commit15b59bee1b04323365da58338a6a70f9dd51fc79 (patch)
tree7589949e03f1732555be050c946da2902ba53d6a /main.c
parentf9bda0ff93ef1211c84cbca02b76ae58bef60767 (diff)
change initialization method + mod_network names
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c12
1 files changed, 11 insertions, 1 deletions
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__, ""}