According to [1], p.90, sec. 6.3.7, TIM16EN and TIM17EN are
bit 17 and 18, but:

$ grep 'RCC_APB2ENR_TIM1[67]EN' include/libopencm3/stm32/f1/rcc.h 
#define RCC_APB2ENR_TIM17EN                     (1 << 17)
#define RCC_APB2ENR_TIM16EN                     (1 << 16)

uses bit 16 and 17.

Patch attached.

Regards,
/Karl Hammar

[1] http://www.st.com/resource/en/reference_manual/cd00246267.pdf

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

diff --git a/include/libopencm3/stm32/f1/rcc.h b/include/libopencm3/stm32/f1/rcc.h
index 828475f..a52f88b 100644
--- a/include/libopencm3/stm32/f1/rcc.h
+++ b/include/libopencm3/stm32/f1/rcc.h
@@ -364,8 +364,8 @@
 @ingroup STM32F1xx_rcc_defines
 
 @{*/
-#define RCC_APB2ENR_TIM17EN			(1 << 17)
-#define RCC_APB2ENR_TIM16EN			(1 << 16)
+#define RCC_APB2ENR_TIM17EN			(1 << 18)
+#define RCC_APB2ENR_TIM16EN			(1 << 17)
 #define RCC_APB2ENR_TIM15EN			(1 << 16)
 #define RCC_APB2ENR_ADC3EN			(1 << 15) /* (XX) */
 #define RCC_APB2ENR_USART1EN			(1 << 14)
@@ -725,4 +725,3 @@ END_DECLS
 
 #endif
 /**@}*/
-
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
libopencm3-devel mailing list
libopencm3-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to