Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions targets/TARGET_STM/TARGET_STM32L4/analogout_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "pinmap.h"
#include "mbed_error.h"
#include "PeripheralPins.h"
#include "mbed_power_mgmt.h"

// These variables are used for the "free" function
static int channel1_used = 0;
Expand Down Expand Up @@ -106,6 +107,9 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap)
}

analogout_write_u16(obj, 0);

/* DAC cannot be used in deepsleep/STOP mode */
sleep_manager_lock_deep_sleep();
}

void analogout_init(dac_t *obj, PinName pin)
Expand Down Expand Up @@ -138,6 +142,8 @@ void analogout_free(dac_t *obj)

// Configure GPIO
pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));

sleep_manager_unlock_deep_sleep();
}

const PinMap *analogout_pinmap()
Expand Down