[riot-notifications] [RIOT-OS/RIOT] gnrc_netif_t: A dynamic approach to ~~GNRC_NETIF_NUMOF~~. (#9903)

Gunar Schorcht notifications at github.com
Tue Jan 15 00:54:35 CET 2019


@miri64 When I was fixing the `esp_wifi` netdev driver for ESP32 PR #10762, I was wondering again whether something like the following construct in the makefile is an acceptable solution to determine automatically the number of network interface during compile time.
```makefile
ifneq (,$(filter esp_now,$(USEMODULE)))
    $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
    USEMODULE += esp_wifi_any
endif

ifneq (,$(filter esp_wifi,$(USEMODULE)))
    $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
    USEMODULE += esp_wifi_any
endif
```
That is, with each enabled netdev driver module, the number of netifs is increased by one. It could be done in same way in driver makefiles or in board definitions.

The problem is that this definition of `GNRC_NETIF_NUMOF` collide with `GNRC_NETIF_NUMOF` in example makefiles, e.g. `gnrc_boarder_router`, why we would have to decide finally where to define it.

BTW, in case of ESP32, I had to add this to `cpu/esp32/Makefile.include` instead of `cpu/esp32/Makefile.dep` because of wrong order here.
https://github.com/RIOT-OS/RIOT/blob/6a4c764c950feddedd000d7d5452ce9302777123/Makefile.include#L282-L293

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/9903#issuecomment-454208959
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190114/8c5a501c/attachment.html>


More information about the notifications mailing list