Skip to content

Commit 6cc1a7a

Browse files
committed
zephyr: Integrate modusocket into build.
1 parent d1015f0 commit 6cc1a7a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

zephyr/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ INC += -I$(ZEPHYR_BASE)/net/ip/contiki/os
3333

3434
SRC_C = main.c \
3535
help.c \
36+
modusocket.c \
3637
modutime.c \
3738
modzephyr.c \
3839
modmachine.c \

zephyr/mpconfigport.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
#define MICROPY_PY_MACHINE (1)
6161
#define MICROPY_MODULE_WEAK_LINKS (1)
6262
#define MICROPY_PY_STRUCT (0)
63+
#ifdef CONFIG_NETWORKING
64+
// If we have networking, we likely want errno comfort
65+
#define MICROPY_PY_UERRNO (1)
66+
#define MICROPY_PY_USOCKET (1)
67+
#endif
6368
#define MICROPY_PY_UTIME (1)
6469
#define MICROPY_PY_UTIME_MP_HAL (1)
6570
#define MICROPY_PY_ZEPHYR (1)
@@ -103,6 +108,7 @@ typedef long mp_off_t;
103108

104109
extern const struct _mp_obj_module_t mp_module_machine;
105110
extern const struct _mp_obj_module_t mp_module_time;
111+
extern const struct _mp_obj_module_t mp_module_usocket;
106112
extern const struct _mp_obj_module_t mp_module_zephyr;
107113

108114
#if MICROPY_PY_UTIME
@@ -119,11 +125,13 @@ extern const struct _mp_obj_module_t mp_module_zephyr;
119125

120126
#define MICROPY_PORT_BUILTIN_MODULES \
121127
{ MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \
128+
{ MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, \
122129
MICROPY_PY_UTIME_DEF \
123130
MICROPY_PY_ZEPHYR_DEF \
124131

125132
#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \
126133
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), MP_ROM_PTR(&mp_module_time) }, \
134+
{ MP_OBJ_NEW_QSTR(MP_QSTR_socket), MP_ROM_PTR(&mp_module_usocket) }, \
127135

128136
// extra built in names to add to the global namespace
129137
#define MICROPY_PORT_BUILTINS \

0 commit comments

Comments
 (0)