summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/builtin.h1
-rw-r--r--py/mpconfig.h4
-rw-r--r--py/objmodule.c3
-rw-r--r--py/py.mk1
-rw-r--r--py/qstrdefs.h4
5 files changed, 13 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h
index 162835cd4f..e3e68e1519 100644
--- a/py/builtin.h
+++ b/py/builtin.h
@@ -105,6 +105,7 @@ extern const mp_obj_module_t mp_module_urandom;
extern const mp_obj_module_t mp_module_ussl;
extern const mp_obj_module_t mp_module_machine;
extern const mp_obj_module_t mp_module_lwip;
+extern const mp_obj_module_t mp_module_websocket;
// extmod functions
MP_DECLARE_CONST_FUN_OBJ(pyb_mount_obj);
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 39070b712e..67bbba7e1f 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -836,6 +836,10 @@ typedef double mp_float_t;
#define MICROPY_PY_USSL (0)
#endif
+#ifndef MICROPY_PY_WEBSOCKET
+#define MICROPY_PY_WEBSOCKET (0)
+#endif
+
/*****************************************************************************/
/* Hooks for a port to add builtins */
diff --git a/py/objmodule.c b/py/objmodule.c
index 1034d00f60..5fd7b82c5b 100644
--- a/py/objmodule.c
+++ b/py/objmodule.c
@@ -193,6 +193,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
#if MICROPY_PY_LWIP
{ MP_ROM_QSTR(MP_QSTR_lwip), MP_ROM_PTR(&mp_module_lwip) },
#endif
+#if MICROPY_PY_WEBSOCKET
+ { MP_ROM_QSTR(MP_QSTR_websocket), MP_ROM_PTR(&mp_module_websocket) },
+#endif
// extra builtin modules as defined by a port
MICROPY_PORT_BUILTIN_MODULES
diff --git a/py/py.mk b/py/py.mk
index 1c746c923f..899f333c62 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -169,6 +169,7 @@ PY_O_BASENAME = \
../extmod/machine_mem.o \
../extmod/modussl.o \
../extmod/modurandom.o \
+ ../extmod/modwebsocket.o \
../extmod/fsusermount.o \
../extmod/vfs_fat.o \
../extmod/vfs_fat_ffconf.o \
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index c8bef1ba39..734354b33e 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -752,3 +752,7 @@ Q(uniform)
Q(VfsFat)
Q(flush)
#endif
+
+#if MICROPY_PY_WEBSOCKET
+Q(websocket)
+#endif