aboutsummaryrefslogtreecommitdiffstats
path: root/source/dac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/dac.cpp')
-rw-r--r--source/dac.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/dac.cpp b/source/dac.cpp
index 2116dcb..ce9c465 100644
--- a/source/dac.cpp
+++ b/source/dac.cpp
@@ -26,13 +26,17 @@ const DACConversionGroup DAC::m_group_config = {
.num_channels = 1,
.end_cb = nullptr,
.error_cb = nullptr,
+#if defined(TARGET_PLATFORM_H7)
.trigger = 5 // TIM6_TRGO
+#elif defined(TARGET_PLATFORM_L4)
+ .trigger = 0 // TIM6_TRGO
+#endif
};
void DAC::begin()
{
- palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
- palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
+ palSetPadMode(GPIOA, 4, PAL_STM32_MODE_ANALOG);
+ palSetPadMode(GPIOA, 5, PAL_STM32_MODE_ANALOG);
dacStart(m_driver[0], &m_config);
dacStart(m_driver[1], &m_config);