Skip to content

Commit e790ff7

Browse files
authored
Merge pull request #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))

0 commit comments

Comments
 (0)