diff --git a/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c index cff01c4..8fb284f 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c @@ -74,6 +74,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c index 62004da..d58f2e4 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c @@ -86,6 +86,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c index 62004da..d58f2e4 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c @@ -86,6 +86,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c index 7ee22c2..67c2b94 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c @@ -121,6 +121,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c index 9c74ed8..f3cd5c6 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c @@ -81,6 +81,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c index bfc27df..99425e9 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c @@ -86,6 +86,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c index 44f240d..bb71818 100644 --- a/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c @@ -90,6 +90,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c index 46efa9a..f560829 100644 --- a/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c @@ -109,6 +109,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c b/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c index e11c851..f152113 100644 --- a/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c @@ -74,6 +74,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c index 1c24712..a31b2b1 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c @@ -90,6 +90,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c index 125e5ef..de737c4 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c @@ -81,6 +81,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c index ab3fe57..7953aa8 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c @@ -97,6 +97,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); /* DAC cannot be used in deepsleep/STOP mode */ sleep_manager_lock_deep_sleep(); diff --git a/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c index f085620..f6d42fe 100644 --- a/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c @@ -94,6 +94,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c b/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c index 01635ae..4ef7478 100644 --- a/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c @@ -80,6 +80,7 @@ } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/analogout_api.c b/targets/TARGET_STM/analogout_api.c index 4dac5ce..c03241c 100644 --- a/targets/TARGET_STM/analogout_api.c +++ b/targets/TARGET_STM/analogout_api.c @@ -41,7 +41,6 @@ static inline void dac_write(dac_t *obj, int value) { HAL_DAC_SetValue(&obj->handle, obj->channel, DAC_ALIGN_12B_R, (value & DAC_RANGE)); - HAL_DAC_Start(&obj->handle, obj->channel); } static inline int dac_read(dac_t *obj)