diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-22 16:06:48 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-22 16:06:48 -0400 |
commit | 5515642bf804870024633c1ad1887f819880b08c (patch) | |
tree | 379535332b4290c7bde9dcb68cfa74c35356baf0 /source/dac.cpp | |
parent | 673eba7167483a92b7a2b8fbfadcccc1f9c3c651 (diff) |
fix L4 DAC trigger; round buffers to even size
Diffstat (limited to 'source/dac.cpp')
-rw-r--r-- | source/dac.cpp | 8 |
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); |