diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2017-01-02 16:17:41 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2017-01-02 16:17:41 +0000 |
commit | 7aa44fe530c4492f07d37844870960f08213e89b (patch) | |
tree | cff78d0bd204d851ed1a22e9e4ba2e4b29a3ba69 /os/hal/ports/STM32 | |
parent | 97d615ea05989c3e85d2baf7438b7ede9723dbcd (diff) | |
download | ChibiOS-7aa44fe530c4492f07d37844870960f08213e89b.tar.gz ChibiOS-7aa44fe530c4492f07d37844870960f08213e89b.tar.bz2 ChibiOS-7aa44fe530c4492f07d37844870960f08213e89b.zip |
Fixed bug 808.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10010 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/STM32F0xx/hal_lld.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/STM32F0xx/hal_lld.c b/os/hal/ports/STM32/STM32F0xx/hal_lld.c index a85e92ac8..847fa8562 100644 --- a/os/hal/ports/STM32/STM32F0xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32F0xx/hal_lld.c @@ -28,6 +28,9 @@ /* Driver local definitions. */
/*===========================================================================*/
+#define STM32_PLLXTPRE_OFFSET 17 /**< PLLXTPRE offset */
+#define STM32_PLLXTPRE_MASK 0x01 /**< PLLXTPRE mask */
+
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -310,7 +313,8 @@ void stm32_clock_init(void) { /* CFGR2 must be configured first since CFGR value could change CFGR2 */
RCC->CFGR2 = STM32_PREDIV;
RCC->CFGR = STM32_PLLNODIV | STM32_MCOPRE | STM32_MCOSEL | STM32_PLLMUL |
- STM32_PLLSRC | STM32_PPRE | STM32_HPRE;
+ STM32_PLLSRC | STM32_PPRE | STM32_HPRE |
+ ((STM32_PREDIV & STM32_PLLXTPRE_MASK) << STM32_PLLXTPRE_OFFSET);
#if STM32_CECSW == STM32_CECSW_OFF
RCC->CFGR3 = STM32_USBSW | STM32_I2C1SW | STM32_USART1SW;
#else
|