From dd9e4fa427d106a716534cf85da4c27a0e932957 Mon Sep 17 00:00:00 2001 From: Anton Staaf Date: Mon, 29 Jun 2015 14:49:59 -0700 Subject: STM32 PWM: Add error case in conditional compilation Ensure that a new chip doesn't default to one of the possible alternate function selection schemes, requiring it to pick one or implement something new. Signed-off-by: Anton Staaf BRANCH=None BUG=None TEST=make buildall -j Change-Id: I3650fa0c99bbf541039a778f4d6398f0a549f1b2 Reviewed-on: https://chromium-review.googlesource.com/282601 Tested-by: Anton Staaf Reviewed-by: Randall Spangler Commit-Queue: Anton Staaf Trybot-Ready: Anton Staaf --- chip/stm32/pwm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chip/stm32/pwm.c b/chip/stm32/pwm.c index c25dd2330e..577e984498 100644 --- a/chip/stm32/pwm.c +++ b/chip/stm32/pwm.c @@ -44,9 +44,11 @@ static void pwm_configure(enum pwm_channel ch) #if defined(CHIP_FAMILY_STM32F0) || defined(CHIP_FAMILY_STM32F3) gpio_set_alternate_function(gpio->port, gpio->mask, pwm->gpio_alt_func); -#else /* stm32l */ +#elif defined(CHIP_FAMILY_STM32L) gpio_set_alternate_function(gpio->port, gpio->mask, GPIO_ALT_TIM(pwm->tim.id)); +#else +#error "GPIO alternate function selection not implemented for chip family." #endif /* Enable timer */ -- cgit v1.2.1