Skip to content
Snippets Groups Projects
Commit 005b4bfb authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

kinetis: Filter out PWM code if no FTM exists

parent 11361ec7
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,12 @@ ...@@ -29,6 +29,12 @@
#include "assert.h" #include "assert.h"
#include "periph/pwm.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) #define PRESCALER_MAX (7U)
static inline FTM_Type *ftm(pwm_t pwm) static inline FTM_Type *ftm(pwm_t pwm)
...@@ -150,3 +156,5 @@ void pwm_poweroff(pwm_t pwm) ...@@ -150,3 +156,5 @@ void pwm_poweroff(pwm_t pwm)
} }
#endif #endif
} }
#endif /* defined(FTM0) */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment