Skip to content

Commit

Permalink
all: Rename MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K.
Browse files Browse the repository at this point in the history
To match MICROPY_PY_NETWORK_CYW43 and MICROPY_PY_NETWORK_NINAW10.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Jun 7, 2022
1 parent 66dfe17 commit 9670a15
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion docs/library/network.WIZNET5K.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class WIZNET5K -- control WIZnet5x00 Ethernet modules

This class allows you to control WIZnet5x00 Ethernet adaptors based on
the W5200 and W5500 chipsets. The particular chipset that is supported
by the firmware is selected at compile-time via the MICROPY_PY_WIZNET5K
by the firmware is selected at compile-time via the MICROPY_PY_NETWORK_WIZNET5K
option.

Example usage::
Expand Down
4 changes: 2 additions & 2 deletions extmod/network_wiznet5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "modmachine.h"
#include "drivers/bus/spi.h"

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K

#include "lib/wiznet5k/Ethernet/wizchip_conf.h"

Expand Down Expand Up @@ -1039,4 +1039,4 @@ const mod_network_nic_type_t mod_network_nic_type_wiznet5k = {
};
#endif

#endif // MICROPY_PY_WIZNET5K
#endif // MICROPY_PY_NETWORK_WIZNET5K
6 changes: 3 additions & 3 deletions ports/rp2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ if (MICROPY_PY_NETWORK_NINAW10)
)
endif()

if (MICROPY_PY_WIZNET5K)
if (MICROPY_PY_NETWORK_WIZNET5K)
target_compile_definitions(${MICROPY_TARGET} PRIVATE
MICROPY_PY_WIZNET5K=1
MICROPY_PY_NETWORK_WIZNET5K=1
WIZCHIP_PREFIXED_EXPORTS=1
_WIZCHIP_=${MICROPY_PY_WIZNET5K}
_WIZCHIP_=${MICROPY_PY_NETWORK_WIZNET5K}
WIZCHIP_YIELD=mpy_wiznet_yield
)

Expand Down
2 changes: 1 addition & 1 deletion ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cmake file for Wiznet W5100S-EVB-Pico.
set(PICO_BOARD pico)
set(MICROPY_PY_WIZNET5K W5100S)
set(MICROPY_PY_NETWORK_WIZNET5K W5100S)
set(MICROPY_PY_LWIP 1)
2 changes: 1 addition & 1 deletion ports/rp2/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_nina;
#define MICROPY_PORT_ROOT_POINTER_NINAW10
#endif

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
#if MICROPY_PY_LWIP
extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
#else
Expand Down
10 changes: 5 additions & 5 deletions ports/rp2/mpnetworkport.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static alarm_id_t lwip_alarm_id = -1;
static bool lwip_can_poll = true;
static bool lwip_poll_pending = false;

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
static bool wiznet_poll_pending = false;

void wiznet5k_poll(void);
Expand All @@ -64,7 +64,7 @@ void lwip_lock_acquire(void) {

void lwip_lock_release(void) {
lwip_can_poll = false;
#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
if (wiznet_poll_pending) {
wiznet5k_poll();
wiznet_poll_pending = false;
Expand All @@ -90,7 +90,7 @@ uint32_t lwip_try_poll(void) {
return ret;
}

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
void wiznet5k_try_poll(void) {
if (lwip_can_poll) {
lwip_can_poll = false;
Expand All @@ -103,14 +103,14 @@ void wiznet5k_try_poll(void) {
#endif

STATIC int64_t alarm_callback(alarm_id_t id, void *user_data) {
#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
wiznet5k_try_poll();
#endif
return (int64_t)lwip_try_poll() * 1000;
}

void mod_network_lwip_init(void) {
#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
wiznet5k_deinit();
#endif
if (lwip_alarm_id != -1) {
Expand Down
6 changes: 3 additions & 3 deletions ports/stm32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -449,17 +449,17 @@ DRIVERS_SRC_C += drivers/cyw43/cyw43_ctrl.c drivers/cyw43/cyw43_lwip.c
LIBS += $(TOP)/drivers/cyw43/libcyw43.a
endif

ifneq ($(MICROPY_PY_WIZNET5K),0)
ifneq ($(MICROPY_PY_NETWORK_WIZNET5K),0)
WIZNET5K_DIR=drivers/wiznet5k
INC += -I$(TOP)/$(WIZNET5K_DIR)
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_WIZNET5K)
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_NETWORK_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_NETWORK_WIZNET5K)
ifeq ($(MICROPY_PY_LWIP),1)
# When using MACRAW mode (with lwIP), maximum buffer space must be used for the raw socket
CFLAGS_MOD += -DWIZCHIP_USE_MAX_BUFFER
endif
SRC_MOD += network_wiznet5k.c modnwwiznet5k.c
SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
ethernet/w$(MICROPY_PY_WIZNET5K)/w$(MICROPY_PY_WIZNET5K).c \
ethernet/w$(MICROPY_PY_NETWORK_WIZNET5K)/w$(MICROPY_PY_NETWORK_WIZNET5K).c \
ethernet/wizchip_conf.c \
ethernet/socket.c \
internet/dns/dns.c \
Expand Down
8 changes: 4 additions & 4 deletions ports/stm32/modnwwiznet5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "pin.h"
#include "spi.h"

#if MICROPY_PY_WIZNET5K && !MICROPY_PY_LWIP
#if MICROPY_PY_NETWORK_WIZNET5K && !MICROPY_PY_LWIP

#include "ethernet/wizchip_conf.h"
#include "ethernet/socket.h"
Expand Down Expand Up @@ -419,7 +419,7 @@ STATIC mp_obj_t wiznet5k_regs(mp_obj_t self_in) {
if (i % 16 == 0) {
printf("\n %04x:", i);
}
#if MICROPY_PY_WIZNET5K == 5200
#if MICROPY_PY_NETWORK_WIZNET5K == 5200
uint32_t reg = i;
#else
uint32_t reg = _W5500_IO_BASE_ | i << 8;
Expand All @@ -432,7 +432,7 @@ STATIC mp_obj_t wiznet5k_regs(mp_obj_t self_in) {
if (i % 16 == 0) {
printf("\n %04x:", i);
}
#if MICROPY_PY_WIZNET5K == 5200
#if MICROPY_PY_NETWORK_WIZNET5K == 5200
uint32_t reg = WIZCHIP_SREG_ADDR(sn, i);
#else
uint32_t reg = _W5500_IO_BASE_ | i << 8 | WIZCHIP_SREG_BLOCK(sn) << 3;
Expand Down Expand Up @@ -510,4 +510,4 @@ const mod_network_nic_type_t mod_network_nic_type_wiznet5k = {
.ioctl = wiznet5k_socket_ioctl,
};

#endif // MICROPY_PY_WIZNET5K && !MICROPY_PY_LWIP
#endif // MICROPY_PY_NETWORK_WIZNET5K && !MICROPY_PY_LWIP
2 changes: 1 addition & 1 deletion ports/stm32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern const struct _mp_obj_type_t mp_network_cyw43_type;
#define MICROPY_HW_NIC_CYW43
#endif

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
#if MICROPY_PY_LWIP
extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
#else
Expand Down
2 changes: 1 addition & 1 deletion ports/stm32/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 0 : no Wiznet support
# 5200 : support for W5200 module
# 5500 : support for W5500 module
MICROPY_PY_WIZNET5K ?= 0
MICROPY_PY_NETWORK_WIZNET5K ?= 0

# cc3k module for wifi support
MICROPY_PY_CC3K ?= 0
Expand Down
4 changes: 2 additions & 2 deletions ports/stm32/mpnetworkport.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// Poll lwIP every 128ms
#define LWIP_TICK(tick) (((tick) & ~(SYSTICK_DISPATCH_NUM_SLOTS - 1) & 0x7f) == 0)

#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
void wiznet5k_poll(void);
#endif

Expand All @@ -57,7 +57,7 @@ u32_t sys_now(void) {
}

STATIC void pyb_lwip_poll(void) {
#if MICROPY_PY_WIZNET5K
#if MICROPY_PY_NETWORK_WIZNET5K
// Poll the NIC for incoming data
wiznet5k_poll();
#endif
Expand Down
8 changes: 4 additions & 4 deletions ports/stm32/network_wiznet5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "extmod/modnetwork.h"
#include "spi.h"

#if MICROPY_PY_WIZNET5K && MICROPY_PY_LWIP
#if MICROPY_PY_NETWORK_WIZNET5K && MICROPY_PY_LWIP

#include "shared/netutils/netutils.h"
#include "drivers/wiznet5k/ethernet/socket.h"
Expand Down Expand Up @@ -295,7 +295,7 @@ STATIC mp_obj_t wiznet5k_regs(mp_obj_t self_in) {
if (i % 16 == 0) {
printf("\n %04x:", i);
}
#if MICROPY_PY_WIZNET5K == 5200
#if MICROPY_PY_NETWORK_WIZNET5K == 5200
uint32_t reg = i;
#else
uint32_t reg = _W5500_IO_BASE_ | i << 8;
Expand All @@ -308,7 +308,7 @@ STATIC mp_obj_t wiznet5k_regs(mp_obj_t self_in) {
if (i % 16 == 0) {
printf("\n %04x:", i);
}
#if MICROPY_PY_WIZNET5K == 5200
#if MICROPY_PY_NETWORK_WIZNET5K == 5200
uint32_t reg = WIZCHIP_SREG_ADDR(sn, i);
#else
uint32_t reg = _W5500_IO_BASE_ | i << 8 | WIZCHIP_SREG_BLOCK(sn) << 3;
Expand Down Expand Up @@ -462,4 +462,4 @@ const mp_obj_type_t mod_network_nic_type_wiznet5k = {
.locals_dict = (mp_obj_dict_t *)&wiznet5k_locals_dict,
};

#endif // MICROPY_PY_WIZNET5K && MICROPY_PY_LWIP
#endif // MICROPY_PY_NETWORK_WIZNET5K && MICROPY_PY_LWIP
8 changes: 4 additions & 4 deletions tools/autobuild/build-stm32-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ fi

# build the versions
do_build pybv3 PYBV3
do_build pybv3-network PYBV3 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pybv3-network PYBV3 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pybv10-dp PYBV10 MICROPY_FLOAT_IMPL=double
do_build pybv10-thread PYBV10 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pybv10-dp-thread PYBV10 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pybv10-network PYBV10 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pybv10-network PYBV10 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pybv11-dp PYBV11 MICROPY_FLOAT_IMPL=double
do_build pybv11-thread PYBV11 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pybv11-dp-thread PYBV11 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pybv11-network PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pybv11-network PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pyblitev10-dp PYBLITEV10 MICROPY_FLOAT_IMPL=double
do_build pyblitev10-thread PYBLITEV10 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pyblitev10-dp-thread PYBLITEV10 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
do_build pyblitev10-network PYBLITEV10 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
do_build pyblitev10-network PYBLITEV10 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1
2 changes: 1 addition & 1 deletion tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function ci_stm32_pyb_build {
make ${MAKEOPTS} -C ports/stm32 submodules
git submodule update --init lib/btstack
git submodule update --init lib/mynewt-nimble
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1 USER_C_MODULES=../../examples/usercmodule
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1 USER_C_MODULES=../../examples/usercmodule
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF6 NANBOX=1 MICROPY_BLUETOOTH_NIMBLE=0 MICROPY_BLUETOOTH_BTSTACK=1
make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA='-DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1'
Expand Down

0 comments on commit 9670a15

Please sign in to comment.