all: Rename MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K.
To match MICROPY_PY_NETWORK_CYW43 and MICROPY_PY_NETWORK_NINAW10. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
66dfe17b18
commit
9670a156da
@ -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::
|
||||
|
@ -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"
|
||||
|
||||
@ -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
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
@ -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;
|
||||
@ -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;
|
||||
@ -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) {
|
||||
|
@ -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 \
|
||||
|
@ -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"
|
||||
@ -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;
|
||||
@ -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;
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
@ -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
|
||||
|
@ -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"
|
||||
@ -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;
|
||||
@ -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;
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user