timers: define ADVANCED_TIMERS in a "portable" manner

gcc7.2 complained about the old syntax.  So, be more verbose.

Fixes: https://github.com/libopencm3/libopencm3/issues/826
This commit is contained in:
Karl Palsson 2017-09-28 11:49:15 +00:00
parent 35ed6926a9
commit af7b2190a9
1 changed files with 5 additions and 1 deletions

View File

@ -114,7 +114,11 @@ knob.
#include <libopencm3/stm32/timer.h>
#include <libopencm3/stm32/rcc.h>
#define ADVANCED_TIMERS (defined(TIM1_BASE) || defined(TIM8_BASE))
#if (defined(TIM1_BASE) || defined(TIM8_BASE))
#define ADVANCED_TIMERS 1
#else
#define ADVANCED_TIMERS 0
#endif
#if defined(TIM8)
#define TIMER_IS_ADVANCED(periph) (((periph) == TIM1) || ((periph) == TIM8))