mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Fri Sep 05 15:45:07 2014 +0100
Parent:
308:29bf8b44dbf6
Child:
310:1c287fe42d43
Commit message:
Synchronized with git revision 3a31537cfb1d117edbf4a79eb60d1db5f453d24f

Full URL: https://github.com/mbedmicro/mbed/commit/3a31537cfb1d117edbf4a79eb60d1db5f453d24f/

[NUCLEO_L152RE] Enable HSI clock for ADC

Changed in this revision

targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c	Fri Sep 05 15:30:07 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c	Fri Sep 05 15:45:07 2014 +0100
@@ -81,6 +81,11 @@
         // Get ADC registers structure address
         adc = (ADC_TypeDef *)(obj->adc);
 
+        // Enable the HSI
+        RCC_HSICmd(ENABLE);
+        // Wait until HSI oscillator is ready
+        while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET) {}
+      
         // Enable ADC clock
         RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);