From 005b4bfbb3c18574f47c2f2c9d4e6c687253a95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Wed, 22 Mar 2017 08:56:25 +0100 Subject: [PATCH] kinetis: Filter out PWM code if no FTM exists --- cpu/kinetis/periph/pwm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpu/kinetis/periph/pwm.c b/cpu/kinetis/periph/pwm.c index 5f2fd448b7..841191ecfc 100644 --- a/cpu/kinetis/periph/pwm.c +++ b/cpu/kinetis/periph/pwm.c @@ -29,6 +29,12 @@ #include "assert.h" #include "periph/pwm.h" +/* This driver uses the FlexTimer module (FTM) for generating PWM signals, but + * not all Kinetis CPUs have such a module. This preprocessor condition prevents + * compilation errors when the CPU header lacks the register definitions for the + * FTM */ +#ifdef FTM0 + #define PRESCALER_MAX (7U) static inline FTM_Type *ftm(pwm_t pwm) @@ -150,3 +156,5 @@ void pwm_poweroff(pwm_t pwm) } #endif } + +#endif /* defined(FTM0) */