Skip to content

Commit 868143e

Browse files
committed
Coding style and add State field init
1 parent c5cc9ec commit 868143e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

targets/TARGET_STM/TARGET_STM32F2/analogout_device.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
#include "mbed_error.h"
3636
#include "PeripheralPins.h"
3737

38-
void analogout_init(dac_t *obj, PinName pin) {
38+
void analogout_init(dac_t *obj, PinName pin)
39+
{
3940
DAC_ChannelConfTypeDef sConfig = {0};
4041

4142
// Get the peripheral name from the pin and assign it to the object
@@ -71,6 +72,8 @@ void analogout_init(dac_t *obj, PinName pin) {
7172

7273
// Configure DAC
7374
obj->handle.Instance = (DAC_TypeDef *)(obj->dac);
75+
obj->handle.State = HAL_DAC_STATE_RESET;
76+
7477
if (HAL_DAC_Init(&obj->handle) != HAL_OK ) {
7578
error("HAL_DAC_Init failed");
7679
}

0 commit comments

Comments
 (0)