mbed library sources. Supersedes mbed-src.

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

Revision:
188:bcfe06ba3d64
Parent:
186:707f6e361f3e
Child:
189:f392fc9709a3
--- a/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c	Thu Sep 06 13:40:20 2018 +0100
+++ b/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c	Thu Nov 08 11:46:34 2018 +0000
@@ -172,6 +172,12 @@
 
     HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
 
+    /* need to wait for some stabilization time after setting the TSEN bit in the ADC_CCR
+    register to wake up the temperature sensor from power down mode */
+    if (sConfig.Channel == ADC_CHANNEL_TEMPSENSOR) {
+        wait_ms(20);
+    }
+
     HAL_ADC_Start(&obj->handle); // Start conversion
 
     // Wait end of conversion and get value