1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc/gomach : Move GNRC_GOMACH_CP_MIN_GAP_US to 'CONFIG_'

This commit is contained in:
Akshai M 2020-05-19 17:48:57 +05:30
parent 1505ea8e11
commit 588200f515
2 changed files with 6 additions and 6 deletions

View File

@ -159,8 +159,8 @@ extern "C" {
* finds its wake-up phase too closed to its receiver's, it will randomly
* select a new phase for itself.
*/
#ifndef GNRC_GOMACH_CP_MIN_GAP_US
#define GNRC_GOMACH_CP_MIN_GAP_US (25U * US_PER_MS)
#ifndef CONFIG_GNRC_GOMACH_CP_MIN_GAP_US
#define CONFIG_GNRC_GOMACH_CP_MIN_GAP_US (25U * US_PER_MS)
#endif
/**

View File

@ -944,15 +944,15 @@ void gnrc_gomach_process_preamble_ack(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
}
if (((uint32_t)phase_us > (CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US -
GNRC_GOMACH_CP_MIN_GAP_US)) ||
((uint32_t)phase_us < GNRC_GOMACH_CP_MIN_GAP_US)) {
CONFIG_GNRC_GOMACH_CP_MIN_GAP_US)) ||
((uint32_t)phase_us < CONFIG_GNRC_GOMACH_CP_MIN_GAP_US)) {
LOG_DEBUG("[GOMACH] t2u: own phase is close to the neighbor's.\n");
gnrc_gomach_set_phase_backoff(netif, true);
/* Set a random phase-backoff value. */
netif->mac.prot.gomach.backoff_phase_us =
random_uint32_range(GNRC_GOMACH_CP_MIN_GAP_US,
random_uint32_range(CONFIG_GNRC_GOMACH_CP_MIN_GAP_US,
(CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US -
GNRC_GOMACH_CP_MIN_GAP_US));
CONFIG_GNRC_GOMACH_CP_MIN_GAP_US));
}
netif->mac.tx.current_neighbor->cp_phase = phase_us;