From 1505ea8e11628945da7f20e6a7e18650bd6f387b Mon Sep 17 00:00:00 2001 From: Akshai M Date: Tue, 19 May 2020 17:44:45 +0530 Subject: [PATCH] gnrc/gomach : Move GNRC_GOMACH_CP_RANDOM_END_US to 'CONIFG_' --- sys/include/net/gnrc/gomach/gomach.h | 8 ++++---- sys/net/gnrc/link_layer/gomach/gomach.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/include/net/gnrc/gomach/gomach.h b/sys/include/net/gnrc/gomach/gomach.h index c963ff34b6..9173606689 100644 --- a/sys/include/net/gnrc/gomach/gomach.h +++ b/sys/include/net/gnrc/gomach/gomach.h @@ -111,12 +111,12 @@ extern "C" { * * Currently, GoMacH's WP is actually composed of * @ref CONFIG_GNRC_GOMACH_CP_DURATION_US and (+) - * @ref GNRC_GOMACH_CP_RANDOM_END_US. We currently introduced this random - * period to avoid beacon collision amongneighbor nodes. This macro may be + * @ref CONFIG_GNRC_GOMACH_CP_RANDOM_END_US. We currently introduced this random + * period to avoid beacon collision among neighbor nodes. This macro may be * removed in the future. */ -#ifndef GNRC_GOMACH_CP_RANDOM_END_US -#define GNRC_GOMACH_CP_RANDOM_END_US (1U * US_PER_MS) +#ifndef CONFIG_GNRC_GOMACH_CP_RANDOM_END_US +#define CONFIG_GNRC_GOMACH_CP_RANDOM_END_US (1U * US_PER_MS) #endif /** diff --git a/sys/net/gnrc/link_layer/gomach/gomach.c b/sys/net/gnrc/link_layer/gomach/gomach.c index d67e90ff51..e1b2dbb2ed 100644 --- a/sys/net/gnrc/link_layer/gomach/gomach.c +++ b/sys/net/gnrc/link_layer/gomach/gomach.c @@ -1482,7 +1482,7 @@ static void gomach_listen_init(gnrc_netif_t *netif) gnrc_gomach_set_enter_new_cycle(netif, false); /* Set listen period timeout. */ - uint32_t listen_period = random_uint32_range(0, GNRC_GOMACH_CP_RANDOM_END_US) + + uint32_t listen_period = random_uint32_range(0, CONFIG_GNRC_GOMACH_CP_RANDOM_END_US) + CONFIG_GNRC_GOMACH_CP_DURATION_US; gnrc_gomach_set_timeout(netif, GNRC_GOMACH_TIMEOUT_CP_END, listen_period); gnrc_gomach_set_timeout(netif, GNRC_GOMACH_TIMEOUT_CP_MAX, GNRC_GOMACH_CP_DURATION_MAX_US);