mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
180:96ed750bd169
Parent:
156:95d6b41a828b
--- a/targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_rcc_ex.c	Thu Dec 07 14:01:42 2017 +0000
+++ b/targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_rcc_ex.c	Wed Jan 17 15:23:54 2018 +0000
@@ -2,8 +2,6 @@
   ******************************************************************************
   * @file    stm32f0xx_hal_rcc_ex.c
   * @author  MCD Application Team
-  * @version V1.5.0
-  * @date    04-November-2016
   * @brief   Extended RCC HAL module driver.
   *          This file provides firmware functions to manage the following 
   *          functionalities RCC extension peripheral:
@@ -61,9 +59,9 @@
   * @{
   */
 /* Bit position in register */
-#define CRS_CFGR_FELIM_BITNUMBER    16U
-#define CRS_CR_TRIM_BITNUMBER       8U
-#define CRS_ISR_FECAP_BITNUMBER     16U
+#define CRS_CFGR_FELIM_BITNUMBER    16
+#define CRS_CR_TRIM_BITNUMBER       8
+#define CRS_ISR_FECAP_BITNUMBER     16
 /**
   * @}
   */
@@ -387,7 +385,9 @@
   */
 uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
 {
+  /* frequency == 0 : means that no available frequency for the peripheral */
   uint32_t frequency = 0U;
+  
   uint32_t srcclk = 0U;
 #if defined(USB)
   uint32_t pllmull = 0U, pllsource = 0U, predivfactor = 0U;
@@ -418,11 +418,6 @@
       {
         frequency = HSE_VALUE / 32U;
       }
-      /* Clock not enabled for RTC*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
   case RCC_PERIPHCLK_USART1:
@@ -450,11 +445,6 @@
       {
         frequency = LSE_VALUE;
       }
-      /* Clock not enabled for USART1*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #if defined(RCC_CFGR3_USART2SW)
@@ -483,11 +473,6 @@
       {
         frequency = LSE_VALUE;
       }
-      /* Clock not enabled for USART2*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #endif /* RCC_CFGR3_USART2SW */
@@ -517,11 +502,6 @@
       {
         frequency = LSE_VALUE;
       }
-      /* Clock not enabled for USART3*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #endif /* RCC_CFGR3_USART3SW */
@@ -540,11 +520,6 @@
       {
         frequency = HAL_RCC_GetSysClockFreq();
       }
-      /* Clock not enabled for I2C1*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #if defined(USB)
@@ -580,7 +555,7 @@
           /* HSI used as PLL clock source : frequency = HSI/PREDIV * PLLMUL */
           frequency = (HSI_VALUE / predivfactor) * pllmull;
 #else
-          /* HSI used as PLL clock source : frequency = HSI/2 * PLLMUL */
+          /* HSI used as PLL clock source : frequency = HSI/2U * PLLMUL */
           frequency = (HSI_VALUE >> 1U) * pllmull;
 #endif /* STM32F042x6 || STM32F048xx || STM32F072xB || STM32F078xx || STM32F070xB */
         }
@@ -592,11 +567,6 @@
         frequency = HSI48_VALUE;
       }
 #endif /* RCC_CR2_HSI48ON */
-      /* Clock not enabled for USB*/
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #endif /* USB */
@@ -616,11 +586,6 @@
       {
         frequency = LSE_VALUE;
       }
-      /* Clock not enabled for CEC */
-      else
-      {
-        frequency = 0U;
-      }
       break;
     }
 #endif /* CEC */