1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12787 from gschorcht/cpu/esp32/netdev_default

cpu/esp*: define esp_now as default netdev
This commit is contained in:
benpicco 2019-11-23 14:59:54 +01:00 committed by GitHub
commit d244b0fe59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 11 deletions

View File

@ -2,14 +2,10 @@ PSEUDOMODULES += olimex_esp32_gateway
USEMODULE += boards_common_esp32
# enables esp_eth as network device
# enables esp_eth as default network device
# cannot be done in Makefile.dep since Makefile.dep is included too late
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
# avoid multiple definitions when package depenedencies are resolved recursively
ifndef MODULE_ESP_ETH_ADDED
MODULE_ESP_ETH_ADDED = 1
USEMODULE += esp_eth
$(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
endif
USEMODULE += esp_eth
endif
include $(RIOTBOARD)/common/esp32/Makefile.include

View File

@ -41,6 +41,13 @@ ifneq (,$(filter esp_gdbstub,$(USEMODULE)))
USEMODULE += esp_gdb
endif
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
# use esp_now as default netdev if no other netdev module is enabled
ifeq (,$(filter esp_wifi esp_eth,$(USEMODULE)))
USEMODULE += esp_now
endif
endif
ifneq (,$(filter esp_now,$(USEMODULE)))
$(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
USEMODULE += esp_wifi_any
@ -51,6 +58,10 @@ ifneq (,$(filter esp_wifi,$(USEMODULE)))
USEMODULE += esp_wifi_any
endif
ifneq (,$(filter esp_eth,$(USEMODULE)))
$(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
endif
ifneq (,$(filter spiffs,$(USEMODULE)))
export RIOT_TEST_TIMEOUT = 300
endif
@ -109,7 +120,7 @@ INCLUDES += -I$(RIOTBOARD)/common/$(CPU)/include
INCLUDES += -I$(RIOTCPU)/$(CPU)
# if any WiFi interface is used, the number of priority levels has to be 32
ifneq (,$(filter esp_wifi_any,$(USEMODULE)))
ifneq (,$(filter esp_wifi_any esp_eth,$(USEMODULE)))
CFLAGS += -DSCHED_PRIO_LEVELS=32
endif

View File

@ -19,10 +19,25 @@ endif
# SPECIAL module dependencies
# cannot be done in Makefile.dep since Makefile.dep is included too late
ifneq (, $(filter esp_now esp_wifi, $(USEMODULE)))
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
# use esp_now as default netdev if no other netdev module is enabled
ifeq (,$(filter esp_wifi esp_eth,$(USEMODULE)))
USEMODULE += esp_now
endif
endif
ifneq (, $(filter esp_wifi, $(USEMODULE)))
$(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
CFLAGS += -DSCHED_PRIO_LEVELS=32
USEMODULE += esp_wifi_any
endif
ifneq (, $(filter esp_now, $(USEMODULE)))
$(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
USEMODULE += esp_wifi_any
endif
ifneq (, $(filter esp_wifi_any, $(USEMODULE)))
CFLAGS += -DSCHED_PRIO_LEVELS=32
USEMODULE += netopt
USEMODULE += xtimer
endif

View File

@ -4,7 +4,8 @@ BOARD_PROVIDES_NETIF := airfy-beacon fox iotlab-m3 mulle native nrf51dk nrf51don
nrf6310 pba-d-01-kw2x samd21-xpro saml21-xpro samr21-xpro spark-core \
yunjia-nrf51822 msba2 \
esp32-mh-et-live-minikit esp32-olimex-evb \
esp32-wemos-lolin-d32-pro esp32-wroom-32 esp32-wrover-kit
esp32-wemos-lolin-d32-pro esp32-wroom-32 esp32-wrover-kit \
esp8266-esp-12x esp8266-olimex-mod esp8266-sparkfun-thing
BOARD_WHITELIST += $(BOARD_PROVIDES_NETIF)