From dab9ea0817bf075aea3c39a51aca19e787e5f96d Mon Sep 17 00:00:00 2001 From: Atis Elsts Date: Tue, 27 Feb 2018 13:19:59 +0000 Subject: [PATCH] nrf52dk: move the build error when building without IPv6 from Makefile to C header file to enable PLATFORMS_EXCLUDE syntax in Makefiles --- arch/cpu/nrf52832/Makefile.nrf52832 | 6 ------ arch/cpu/nrf52832/nrf52832-def.h | 5 +++++ .../nrf52dk/coap-demo/coap-client/Makefile | 2 ++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/cpu/nrf52832/Makefile.nrf52832 b/arch/cpu/nrf52832/Makefile.nrf52832 index 567270834..b38f08438 100644 --- a/arch/cpu/nrf52832/Makefile.nrf52832 +++ b/arch/cpu/nrf52832/Makefile.nrf52832 @@ -14,12 +14,6 @@ endif # custom MAC: ble_ipsp_mac_driver MAKE_MAC ?= MAKE_MAC_OTHER -# we only support IPv6 -MAKE_NET ?= MAKE_NET_IPV6 -ifneq ($(MAKE_NET),MAKE_NET_IPV6) - $(error Only IPv6 stack is supported!) -endif - $(info SDK: $(NRF52_SDK_ROOT)) ifeq ($(NRF52_DK_REVISION),) diff --git a/arch/cpu/nrf52832/nrf52832-def.h b/arch/cpu/nrf52832/nrf52832-def.h index f31054dda..b5eca1b5e 100644 --- a/arch/cpu/nrf52832/nrf52832-def.h +++ b/arch/cpu/nrf52832/nrf52832-def.h @@ -34,6 +34,11 @@ /*---------------------------------------------------------------------------*/ #include "cm4/cm4-def.h" /*---------------------------------------------------------------------------*/ +#if !NETSTACK_CONF_WITH_IPV6 +/* we only support IPv6 */ +#error "Only IPv6 stack is supported!" +#endif +/*---------------------------------------------------------------------------*/ #define RTIMER_ARCH_SECOND 62500 /*---------------------------------------------------------------------------*/ #endif /* NRF52832_DEF_H_ */ diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile b/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile index 940707151..b7a5ff778 100644 --- a/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile +++ b/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile @@ -9,6 +9,8 @@ $(warning Using default SERVER_IPV6_EP=fd00::1) SERVER_IPV6_EP=fd00::1 endif +CFLAGS += -DSERVER_IPV6_EP=\"$(SERVER_IPV6_EP)\" + CFLAGS += -DDEVICE_NAME=\"nRF52_DK_CoAP_Client\" CFLAGS += -DCOAP_OBSERVE_CLIENT=1