From fe180daa3b2ebf111c6c74f5fdcf23d4c039f9be Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 21 Nov 2019 09:22:30 +0100 Subject: [PATCH] sys/include/net/gnrc/gomach.h: fix cpp preprocessorErrorDirective Preprocesor fails to evaluate the if condicion on L91-92 because RTT_FREQUENCY is not defined, and therefore a division by 0 occurs. TO avoid this replicate the RTT_FREQUENCY undefined warning. --- sys/include/net/gnrc/gomach/gomach.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/include/net/gnrc/gomach/gomach.h b/sys/include/net/gnrc/gomach/gomach.h index 5f2135a256..1f7d7fb307 100644 --- a/sys/include/net/gnrc/gomach/gomach.h +++ b/sys/include/net/gnrc/gomach/gomach.h @@ -85,6 +85,9 @@ extern "C" { #define GNRC_GOMACH_SUPERFRAME_DURATION_US (300LU * US_PER_MS) #endif +#ifndef RTT_FREQUENCY +#error "RTT_FREQUENCY undefined." +#else #if ((GNRC_GOMACH_SUPERFRAME_DURATION_US < ((1000LU *US_PER_MS) / RTT_FREQUENCY)) || \ (GNRC_GOMACH_SUPERFRAME_DURATION_US < (10 *GNRC_GOMACH_CP_DURATION_US))) #undef GNRC_GOMACH_SUPERFRAME_DURATION_US @@ -94,6 +97,7 @@ extern "C" { #define GNRC_GOMACH_SUPERFRAME_DURATION_US (10 * GNRC_GOMACH_CP_DURATION_US) #endif #endif +#endif /** * @brief The maximum duration of the random period at the end of GoMacH's