mbed library sources. Supersedes mbed-src.

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

Revision:
176:447f873cad2f
Parent:
168:9672193075cf
Child:
187:0387e8f68319
--- a/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c	Wed Oct 11 12:45:49 2017 +0100
+++ b/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c	Wed Oct 25 14:53:38 2017 +0100
@@ -36,7 +36,7 @@
 #include "PeripheralPins.h"
 
 void analogout_init(dac_t *obj, PinName pin) {
-    DAC_ChannelConfTypeDef sConfig;
+    DAC_ChannelConfTypeDef sConfig = {0};
 
     // Get the peripheral name from the pin and assign it to the object
     obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC);
@@ -71,6 +71,8 @@
 
     // Configure DAC
     obj->handle.Instance = (DAC_TypeDef *)(obj->dac);
+    obj->handle.State = HAL_DAC_STATE_RESET;
+
     if (HAL_DAC_Init(&obj->handle) != HAL_OK ) {
         error("HAL_DAC_Init failed");
     }