Skip to content

Commit e790ff7

Browse files
authored
Merge pull request micropython#5036 from tannewt/esp_oserror0
Remove OSError(0) and old network modules
2 parents 295f63d + 79aaa3c commit e790ff7

File tree

30 files changed

+14
-1864
lines changed

30 files changed

+14
-1864
lines changed

docs/redirects.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,3 @@ shared-bindings/vectorio/__init__.rst shared-bindings/vectorio/
157157
shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode
158158
shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer
159159
shared-bindings/watchdog/__init__.rst shared-bindings/watchdog/
160-
shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K
161-
shared-bindings/wiznet/__init__.rst shared-bindings/wiznet/

docs/shared_bindings_matrix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
additional_modules = {
6262
"fontio": "CIRCUITPY_DISPLAYIO",
6363
"terminalio": "CIRCUITPY_DISPLAYIO",
64-
# "socket": "CIRCUITPY_NETWORK",
6564
"adafruit_bus_device": "CIRCUITPY_BUSDEVICE",
6665
"adafruit_pixelbuf": "CIRCUITPY_PIXELBUF"
6766
}

main.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@
9595
#include "shared-module/memorymonitor/__init__.h"
9696
#endif
9797

98-
#if CIRCUITPY_NETWORK
99-
#include "shared-module/network/__init__.h"
100-
#endif
101-
10298
#if CIRCUITPY_USB_HID
10399
#include "shared-module/usb_hid/__init__.h"
104100
#endif
@@ -169,17 +165,9 @@ STATIC void start_mp(supervisor_allocation* heap) {
169165
// Reset alarm module only after we retrieved the wakeup alarm.
170166
alarm_reset();
171167
#endif
172-
173-
#if CIRCUITPY_NETWORK
174-
network_module_init();
175-
#endif
176168
}
177169

178170
STATIC void stop_mp(void) {
179-
#if CIRCUITPY_NETWORK
180-
network_module_deinit();
181-
#endif
182-
183171
#if MICROPY_VFS
184172
mp_vfs_mount_t *vfs = MP_STATE_VM(vfs_mount_table);
185173

ports/atmel-samd/Makefile

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -326,32 +326,6 @@ ifeq ($(CIRCUITPY_SDIOIO),1)
326326
SRC_C += ports/atmel-samd/sd_mmc/sd_mmc.c
327327
endif
328328

329-
ifeq ($(CIRCUITPY_NETWORK),1)
330-
CFLAGS += -DMICROPY_PY_NETWORK=1
331-
332-
SRC_MOD += lib/netutils/netutils.c
333-
334-
ifneq ($(MICROPY_PY_WIZNET5K),0)
335-
WIZNET5K_DIR=drivers/wiznet5k
336-
INC += -I$(TOP)/$(WIZNET5K_DIR)
337-
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_WIZNET5K)
338-
SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
339-
ethernet/w$(MICROPY_PY_WIZNET5K)/w$(MICROPY_PY_WIZNET5K).c \
340-
ethernet/wizchip_conf.c \
341-
ethernet/socket.c \
342-
internet/dns/dns.c \
343-
internet/dhcp/dhcp.c \
344-
)
345-
346-
endif # MICROPY_PY_WIZNET5K
347-
endif # CIRCUITPY_NETWORK
348-
349-
ifeq ($(CIRCUITPY_NETWORK),1)
350-
ifneq ($(MICROPY_PY_WIZNET5K),0)
351-
SRC_SHARED_MODULE += wiznet/__init__.c wiznet/wiznet5k.c
352-
endif
353-
endif
354-
355329
# The smallest SAMD51 packages don't have I2S. Everything else does.
356330
ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
357331
SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c

ports/atmel-samd/background.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "supervisor/usb.h"
3232

3333
#include "py/runtime.h"
34-
#include "shared-module/network/__init__.h"
3534
#include "supervisor/shared/stack.h"
3635
#include "supervisor/port.h"
3736

ports/atmel-samd/mpconfigport.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0
9797

9898
# The ?='s allow overriding in mpconfigboard.mk.
9999

100-
CIRCUITPY_NETWORK ?= 0
101100
CIRCUITPY_PS2IO ?= 1
102101
CIRCUITPY_SAMD ?= 1
103102
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FULL_BUILD)
@@ -116,7 +115,6 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0
116115

117116
# The ?='s allow overriding in mpconfigboard.mk.
118117

119-
CIRCUITPY_NETWORK ?= 0
120118
CIRCUITPY_PS2IO ?= 1
121119
CIRCUITPY_SAMD ?= 1
122120
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FULL_BUILD)

ports/esp32s2/common-hal/socketpool/Socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void common_hal_socketpool_socket_close(socketpool_socket_obj_t *self) {
144144
}
145145
}
146146

147-
bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self,
147+
void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self,
148148
const char *host, size_t hostlen, uint32_t port) {
149149
const struct addrinfo hints = {
150150
.ai_family = AF_INET,
@@ -184,7 +184,7 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self,
184184

185185
if (result >= 0) {
186186
self->connected = true;
187-
return true;
187+
return;
188188
} else {
189189
mp_raise_OSError(errno);
190190
}

ports/esp32s2/common-hal/ssl/SSLSocket.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void common_hal_ssl_sslsocket_close(ssl_sslsocket_obj_t *self) {
5353
self->tls = NULL;
5454
}
5555

56-
bool common_hal_ssl_sslsocket_connect(ssl_sslsocket_obj_t *self,
56+
void common_hal_ssl_sslsocket_connect(ssl_sslsocket_obj_t *self,
5757
const char *host, size_t hostlen, uint32_t port) {
5858
esp_tls_cfg_t *tls_config = NULL;
5959
tls_config = &self->ssl_context->ssl_config;
@@ -84,8 +84,6 @@ bool common_hal_ssl_sslsocket_connect(ssl_sslsocket_obj_t *self,
8484
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
8585
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
8686
}
87-
88-
return self->sock->connected;
8987
}
9088

9189
bool common_hal_ssl_sslsocket_get_closed(ssl_sslsocket_obj_t *self) {

ports/mimxrt10xx/Makefile

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -162,33 +162,6 @@ SRC_C += \
162162
reset.c \
163163
supervisor/flexspi_nor_flash_ops.c
164164

165-
166-
ifeq ($(CIRCUITPY_NETWORK),1)
167-
CFLAGS += -DMICROPY_PY_NETWORK=1
168-
169-
SRC_MOD += lib/netutils/netutils.c
170-
171-
ifneq ($(MICROPY_PY_WIZNET5K),0)
172-
WIZNET5K_DIR=drivers/wiznet5k
173-
INC += -I$(TOP)/$(WIZNET5K_DIR)
174-
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_WIZNET5K)
175-
SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
176-
ethernet/w$(MICROPY_PY_WIZNET5K)/w$(MICROPY_PY_WIZNET5K).c \
177-
ethernet/wizchip_conf.c \
178-
ethernet/socket.c \
179-
internet/dns/dns.c \
180-
internet/dhcp/dhcp.c \
181-
)
182-
183-
endif # MICROPY_PY_WIZNET5K
184-
endif # CIRCUITPY_NETWORK
185-
186-
ifeq ($(CIRCUITPY_NETWORK),1)
187-
ifneq ($(MICROPY_PY_WIZNET5K),0)
188-
SRC_SHARED_MODULE += wiznet/__init__.c wiznet/wiznet5k.c
189-
endif
190-
endif
191-
192165
# TODO
193166
#ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
194167
#SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c

ports/nrf/Makefile

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -182,32 +182,6 @@ SRC_C += \
182182
endif
183183
endif # CIRCUITPY_USB
184184

185-
ifeq ($(CIRCUITPY_NETWORK),1)
186-
CFLAGS += -DMICROPY_PY_NETWORK=1
187-
188-
SRC_MOD += lib/netutils/netutils.c
189-
190-
ifneq ($(MICROPY_PY_WIZNET5K),0)
191-
WIZNET5K_DIR=drivers/wiznet5k
192-
INC += -I$(TOP)/$(WIZNET5K_DIR)
193-
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_WIZNET5K)
194-
SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
195-
ethernet/w$(MICROPY_PY_WIZNET5K)/w$(MICROPY_PY_WIZNET5K).c \
196-
ethernet/wizchip_conf.c \
197-
ethernet/socket.c \
198-
internet/dns/dns.c \
199-
internet/dhcp/dhcp.c \
200-
)
201-
202-
endif # MICROPY_PY_WIZNET5K
203-
endif # CIRCUITPY_NETWORK
204-
205-
ifeq ($(CIRCUITPY_NETWORK),1)
206-
ifneq ($(MICROPY_PY_WIZNET5K),0)
207-
SRC_SHARED_MODULE += wiznet/__init__.c wiznet/wiznet5k.c
208-
endif
209-
endif
210-
211185
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
212186
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
213187
$(addprefix common-hal/, $(SRC_COMMON_HAL))

py/circuitpy_defns.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ endif
214214
ifeq ($(CIRCUITPY_NEOPIXEL_WRITE),1)
215215
SRC_PATTERNS += neopixel_write/%
216216
endif
217-
ifeq ($(CIRCUITPY_NETWORK),1)
218-
SRC_PATTERNS += network/% socket/%
219-
endif
220217
ifeq ($(CIRCUITPY_NVM),1)
221218
SRC_PATTERNS += nvm/%
222219
endif

py/circuitpy_mpconfig.h

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -578,23 +578,6 @@ extern const struct _mp_obj_module_t neopixel_write_module;
578578
#define NEOPIXEL_WRITE_MODULE
579579
#endif
580580

581-
#if CIRCUITPY_NETWORK
582-
extern const struct _mp_obj_module_t network_module;
583-
extern const struct _mp_obj_module_t socket_module;
584-
#define NETWORK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&network_module },
585-
#define SOCKET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&socket_module },
586-
#define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list;
587-
#if MICROPY_PY_WIZNET5K
588-
extern const struct _mp_obj_module_t wiznet_module;
589-
#define WIZNET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_wiznet), (mp_obj_t)&wiznet_module },
590-
#endif
591-
#else
592-
#define NETWORK_MODULE
593-
#define SOCKET_MODULE
594-
#define WIZNET_MODULE
595-
#define NETWORK_ROOT_POINTERS
596-
#endif
597-
598581
// This is not a top-level module; it's microcontroller.nvm.
599582
#if CIRCUITPY_NVM
600583
extern const struct _mp_obj_module_t nvm_module;
@@ -918,9 +901,6 @@ extern const struct _mp_obj_module_t msgpack_module;
918901
MICROCONTROLLER_MODULE \
919902
MSGPACK_MODULE \
920903
NEOPIXEL_WRITE_MODULE \
921-
NETWORK_MODULE \
922-
SOCKET_MODULE \
923-
WIZNET_MODULE \
924904
PEW_MODULE \
925905
PIXELBUF_MODULE \
926906
PS2IO_MODULE \
@@ -977,24 +957,20 @@ extern const struct _mp_obj_module_t msgpack_module;
977957
struct _supervisor_allocation_node;
978958

979959
#define CIRCUITPY_COMMON_ROOT_POINTERS \
980-
const char *readline_hist[8]; \
981-
vstr_t *repl_line; \
982-
mp_obj_t rtc_time_source; \
983-
GAMEPAD_ROOT_POINTERS \
960+
FLASH_ROOT_POINTERS \
984961
KEYPAD_ROOT_POINTERS \
985-
mp_obj_t pew_singleton; \
962+
GAMEPAD_ROOT_POINTERS \
986963
BOARD_UART_ROOT_POINTER \
987-
FLASH_ROOT_POINTERS \
988964
MEMORYMONITOR_ROOT_POINTERS \
989-
NETWORK_ROOT_POINTERS \
965+
vstr_t *repl_line; \
966+
mp_obj_t pew_singleton; \
967+
mp_obj_t rtc_time_source; \
968+
const char *readline_hist[8]; \
990969
struct _supervisor_allocation_node *first_embedded_allocation; \
991970

992971
void supervisor_run_background_tasks_if_tick(void);
993972
#define RUN_BACKGROUND_TASKS (supervisor_run_background_tasks_if_tick())
994973

995-
// TODO: Used in wiznet5k driver, but may not be needed in the long run.
996-
#define MICROPY_THREAD_YIELD()
997-
998974
#define MICROPY_VM_HOOK_LOOP RUN_BACKGROUND_TASKS;
999975
#define MICROPY_VM_HOOK_RETURN RUN_BACKGROUND_TASKS;
1000976

py/circuitpy_mpconfig.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)
217217
CIRCUITPY_NEOPIXEL_WRITE ?= 1
218218
CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
219219

220-
# Enabled on SAMD51. Won't fit on SAMD21 builds. Not tested on nRF or STM32F4 builds.
221-
CIRCUITPY_NETWORK ?= 0
222-
CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK)
223-
224220
CIRCUITPY_NVM ?= 1
225221
CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
226222

shared-bindings/network/__init__.c

Lines changed: 0 additions & 72 deletions
This file was deleted.

shared-bindings/network/__init__.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)