Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/esp*: define esp_now as default netdev #12787

Merged
merged 5 commits into from
Nov 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions boards/esp32-olimex-evb/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion cpu/esp32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ ifneq (,$(filter esp_gdbstub,$(USEMODULE)))
USEMODULE += esp_gdb
endif

ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
benpicco marked this conversation as resolved.
Show resolved Hide resolved
# 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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
19 changes: 17 additions & 2 deletions cpu/esp8266/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/netstats_l2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down