Skip to content
Snippets Groups Projects
Commit 1f542142 authored by David Sidrane's avatar David Sidrane
Browse files

stm32/drv_io_timer:GTIM_CCER_CC1NP not on all STM32 HW

   The F1 series GTIMs to not have GTIM_CCER_CC1NP.
   This bug fix tracks the upstream change that
   made GTIM_CCER_CC1NP conditional on the chip.
parent 7ba81fac
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,12 @@
#include <stm32_gpio.h>
#include <stm32_tim.h>
#if defined(HAVE_GTIM_CCXNP)
#define HW_GTIM_CCER_CC1NP GTIM_CCER_CC1NP
#else
# define HW_GTIM_CCER_CC1NP 0
#endif
#define arraySize(a) (sizeof((a))/sizeof(((a)[0])))
/* If the timer clock source provided as clock_freq is the STM32_APBx_TIMx_CLKIN
......@@ -729,7 +735,7 @@ int io_timer_channel_init(unsigned channel, io_timer_channel_mode_t mode,
/* on PWM Out ccer_setbits is 0 */
clearbits = (GTIM_CCER_CC1E | GTIM_CCER_CC1P | GTIM_CCER_CC1NP) << (shifts * CCER_C1_NUM_BITS);
clearbits = (GTIM_CCER_CC1E | GTIM_CCER_CC1P | HW_GTIM_CCER_CC1NP) << (shifts * CCER_C1_NUM_BITS);
setbits = ccer_setbits << (shifts * CCER_C1_NUM_BITS);
rvalue = rCCER(timer);
rvalue &= ~clearbits;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment