diff --git a/examples/ipv6/rpl-simple/Makefile b/examples/ipv6/rpl-simple/Makefile index e0246b8b9..7f9c6cbb4 100644 --- a/examples/ipv6/rpl-simple/Makefile +++ b/examples/ipv6/rpl-simple/Makefile @@ -3,12 +3,8 @@ CONTIKI=../../.. CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" -WITH_TSCH ?= 0 - -ifeq ($(WITH_TSCH),1) -MAKE_MAC = MAKE_MAC_TSCH -endif -CFLAGS += -DWITH_TSCH=$(WITH_TSCH) +# Set MAKE_MAC = MAKE_MAC_TSCH to run TSCH instead +MAKE_MAC = MAKE_MAC_CSMA CONTIKI_WITH_IPV6 = 1 CONTIKI_WITH_RPL_LITE = 1 diff --git a/examples/ipv6/rpl-simple/node.c b/examples/ipv6/rpl-simple/node.c index 287d9f530..4c3cc0004 100644 --- a/examples/ipv6/rpl-simple/node.c +++ b/examples/ipv6/rpl-simple/node.c @@ -148,9 +148,9 @@ PROCESS_THREAD(node_process, ev, data) etimer_set(&periodic, START_INTERVAL); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&periodic)); -#if WITH_TSCH +#if MAC_CONF_WITH_TSCH NETSTACK_MAC.on(); -#endif /* WITH_TSCH */ +#endif /* MAC_CONF_WITH_TSCH */ if(!uip_ip6addr_cmp(&destination_ipaddr, &node_ipaddr)) { /* Send data periodically */ diff --git a/examples/ipv6/rpl-simple/project-conf.h b/examples/ipv6/rpl-simple/project-conf.h index 8fea9fe91..83f9225ed 100644 --- a/examples/ipv6/rpl-simple/project-conf.h +++ b/examples/ipv6/rpl-simple/project-conf.h @@ -46,7 +46,7 @@ #undef SICSLOWPAN_CONF_FRAG #define SICSLOWPAN_CONF_FRAG 0 -#if WITH_TSCH +#if MAC_CONF_WITH_TSCH /*******************************************************/ /********************* Configure TSCH *********************/ @@ -87,6 +87,6 @@ #undef TSCH_SCHEDULE_CONF_MAX_LINKS #define TSCH_SCHEDULE_CONF_MAX_LINKS 4 -#endif /* WITH_TSCH */ +#endif /* MAC_CONF_WITH_TSCH */ #endif diff --git a/examples/platform-specific/jn516x/tsch/common-conf.h b/examples/platform-specific/jn516x/tsch/common-conf.h index 50f379591..886ce4884 100644 --- a/examples/platform-specific/jn516x/tsch/common-conf.h +++ b/examples/platform-specific/jn516x/tsch/common-conf.h @@ -36,7 +36,6 @@ /* Global config flags */ -#define WITH_TSCH 1 #define WITH_TSCH_SECURITY 0 #define TSCH_LOG_CONF_PER_SLOT 1 #define WITH_COAP_RESOURCES 0 @@ -129,7 +128,7 @@ #define TSCH_CONF_JOIN_SECURED_ONLY 0 #endif /* WITH_TSCH_SECURITY */ -#if !WITH_TSCH /* No TSCH, use Csma with ACK (default MAC) */ +#if MAC_CONF_WITH_CSMA /* Configure Csma with ACK (default MAC) */ #undef MICROMAC_CONF_CHANNEL #define MICROMAC_CONF_CHANNEL 26 @@ -141,7 +140,7 @@ #undef MIRCOMAC_CONF_BUF_NUM #define MIRCOMAC_CONF_BUF_NUM 4 -#endif +#endif /* MAC_CONF_WITH_CSMA */ #undef CONTIKI_VERSION_STRING #define CONTIKI_VERSION_STRING "Contiki 3.x" diff --git a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c index d8c23b752..c96c1973b 100644 --- a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c +++ b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c @@ -167,9 +167,9 @@ PROCESS_THREAD(node_process, ev, data) printf("Init: node starting with role %s\n", node_role == role_6ln ? "6ln" : (node_role == role_6dr) ? "6dr" : "6dr-sec"); -#if WITH_TSCH +#if MAC_CONF_WITH_TSCH tsch_set_pan_secured(LLSEC802154_ENABLED && (node_role == role_6dr_sec)); -#endif /* WITH_TSCH */ +#endif /* MAC_CONF_WITH_TSCH */ is_coordinator = node_role > role_6ln; if(is_coordinator) { diff --git a/tests/13-ieee802154/code/Makefile b/tests/13-ieee802154/code/Makefile index e5856857d..59303e330 100644 --- a/tests/13-ieee802154/code/Makefile +++ b/tests/13-ieee802154/code/Makefile @@ -4,11 +4,8 @@ MAKE_MAC = MAKE_MAC_TSCH MODULES += os/services/unit-test CFLAGS += -D PROJECT_CONF_H=\"project-conf.h\" -WITH_TSCH ?= 0 TEST_CONFIG_TYPE ?= DEFAULT -CFLAGS += -D WITH_TSCH=1 - ifeq ($(TEST_CONFIG_TYPE), SECURITY_ON) CFLAGS += -D WITH_SECURITY_ON=1 endif diff --git a/tests/13-ieee802154/code/project-conf.h b/tests/13-ieee802154/code/project-conf.h index 21f67b70f..5c17b28a2 100644 --- a/tests/13-ieee802154/code/project-conf.h +++ b/tests/13-ieee802154/code/project-conf.h @@ -34,8 +34,8 @@ #define UNIT_TEST_PRINT_FUNCTION test_print_report -#if WITH_TSCH +#if MAC_CONF_WITH_TSCH #include "project-tsch-conf.h" -#endif +#endif /* MAC_CONF_WITH_TSCH */ #endif /* !_PROJECT_CONF_H_ */