Skip to content

Commit 5400d9b

Browse files
committed
DAC: STM32F3 dac may have output switch instead of output buffer
For STM32F3 serie, depending on instance/channel used, output buffer may be replaced by output switch Both being exclusive, they can be both set in HAL structure. Fixes #1324 Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
1 parent 6ec82f6 commit 5400d9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/SrcWrapper/src/stm32/analog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ void dac_write_value(PinName pin, uint32_t value, uint8_t do_init)
404404

405405
dacChannelConf.DAC_Trigger = DAC_TRIGGER_NONE;
406406
dacChannelConf.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE;
407+
#if defined(DAC_OUTPUTSWITCH_ENABLE)
408+
dacChannelConf.DAC_OutputSwitch = DAC_OUTPUTSWITCH_ENABLE;
409+
#endif
407410
/*##-2- Configure DAC channel1 #############################################*/
408411
if (HAL_DAC_ConfigChannel(&DacHandle, &dacChannelConf, dacChannel) != HAL_OK) {
409412
/* Channel configuration Error */

0 commit comments

Comments
 (0)