diff options
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/STM32/icu_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM32/stm32.h | 15 | ||||
-rw-r--r-- | os/hal/platforms/STM32F4xx/hal_lld.c | 7 | ||||
-rw-r--r-- | os/hal/platforms/STM32L1xx/hal_lld.c | 8 |
4 files changed, 13 insertions, 19 deletions
diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index e76f8a109..dfbcee5e6 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -360,7 +360,7 @@ void icu_lld_start(ICUDriver *icup) { icup->tim->ARR = 0xFFFF;
/* CCMR1_CC1S = 01 = CH1 Input on TI1.
- CCMR1_CC2S = 10 = CH2 Input on TI2.*/
+ CCMR1_CC2S = 10 = CH2 Input on TI1.*/
icup->tim->CCMR1 = TIM_CCMR1_CC1S_0 |
TIM_CCMR1_CC2S_1;
/* SMCR_TS = 101, input is TI1FP1.
diff --git a/os/hal/platforms/STM32/stm32.h b/os/hal/platforms/STM32/stm32.h index 0ee083dcc..c051dafe0 100644 --- a/os/hal/platforms/STM32/stm32.h +++ b/os/hal/platforms/STM32/stm32.h @@ -63,21 +63,6 @@ #include "stm32l1xx.h"
#endif
-#undef TIM1
-#undef TIM2
-#undef TIM3
-#undef TIM4
-#undef TIM5
-#undef TIM6
-#undef TIM7
-#undef TIM8
-#undef TIM9
-#undef TIM10
-#undef TIM11
-#undef TIM12
-#undef TIM13
-#undef TIM14
-
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
diff --git a/os/hal/platforms/STM32F4xx/hal_lld.c b/os/hal/platforms/STM32F4xx/hal_lld.c index 5033c41c8..6922ff3df 100644 --- a/os/hal/platforms/STM32F4xx/hal_lld.c +++ b/os/hal/platforms/STM32F4xx/hal_lld.c @@ -62,8 +62,9 @@ void hal_lld_init(void) { been initialized in the board initialization file (board.c).*/
rccResetAHB1(!0);
rccResetAHB2(!0);
+ rccResetAHB3(!0);
rccResetAPB1(!RCC_APB1RSTR_PWRRST);
- rccResetAPB2(!RCC_APB2RSTR_SYSCFGRST);
+ rccResetAPB2(!0);
/* SysTick initialization using the system clock.*/
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
@@ -152,6 +153,10 @@ void stm32_clock_init(void) { ;
#endif
#endif /* STM32_NO_INIT */
+
+ /* SYSCFG clock enabled here because it is a multi-functional unit shared
+ among multiple drivers.*/
+ rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, TRUE);
}
/** @} */
diff --git a/os/hal/platforms/STM32L1xx/hal_lld.c b/os/hal/platforms/STM32L1xx/hal_lld.c index c59aa3f1c..96b18a656 100644 --- a/os/hal/platforms/STM32L1xx/hal_lld.c +++ b/os/hal/platforms/STM32L1xx/hal_lld.c @@ -60,8 +60,8 @@ void hal_lld_init(void) { /* Reset of all peripherals.*/
rccResetAHB(!RCC_AHBRSTR_FLITFRST);
- rccResetAPB1(!0);
- rccResetAPB2(!RCC_APB2RSTR_SYSCFGRST);
+ rccResetAPB1(!RCC_APB1RSTR_PWRRST);
+ rccResetAPB2(!0);
/* SysTick initialization using the system clock.*/
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
@@ -170,6 +170,10 @@ void stm32_clock_init(void) { ;
#endif
#endif /* STM32_NO_INIT */
+
+ /* SYSCFG clock enabled here because it is a multi-functional unit shared
+ among multiple drivers.*/
+ rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, TRUE);
}
#else
void stm32_clock_init(void) {}
|