Skip to content

Commit

Permalink
sys/include/net/gnrc/gomach.h: fix cpp preprocessorErrorDirective
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fjmolinas committed Nov 21, 2019
1 parent d2e90b2 commit fe180da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sys/include/net/gnrc/gomach/gomach.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fe180da

Please sign in to comment.