Skip to content

Commit cba1ff1

Browse files
committed
chore(wl3): DAC support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 2e5e44f commit cba1ff1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/SrcWrapper/src/stm32/analog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,11 @@ void dac_write_value(PinName pin, uint32_t value, uint8_t do_init)
474474
}
475475

476476
/*##-3- Set DAC Channel1 DHR register ######################################*/
477+
#if defined(DAC_ALIGN_12B_R)
477478
if (HAL_DAC_SetValue(&DacHandle, dacChannel, DAC_ALIGN_12B_R, value) != HAL_OK) {
479+
#else
480+
if (HAL_DAC_SetValue(&DacHandle, dacChannel, DAC_ALIGN_6B_R, value) != HAL_OK) {
481+
#endif
478482
/* Setting value Error */
479483
return;
480484
}

0 commit comments

Comments
 (0)