Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: XRangePingPong XRange-LoRaWAN-lmic-app lora-transceiver
Revision 309:8f72041da6ba, committed 2014-09-05
- 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);