diff options
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/ports/STM32/LLD/DACv1/dac_lld.c | 5 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/DACv1/dac_lld.h | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/DACv1/dac_lld.c b/os/hal/ports/STM32/LLD/DACv1/dac_lld.c index 6aabd7f34..8fc51ae88 100644 --- a/os/hal/ports/STM32/LLD/DACv1/dac_lld.c +++ b/os/hal/ports/STM32/LLD/DACv1/dac_lld.c @@ -251,10 +251,11 @@ void dac_lld_start(DACDriver *dacp) { #if STM32_DAC_DUAL_MODE == FALSE
dacp->params->dac->CR &= dacp->params->regmask;
dacp->params->dac->CR |= DAC_CR_EN1 << dacp->params->regshift;
- *(&dacp->params->dac->DHR12R1 + dacp->params->dataoffset) = 0U;
+ dac_lld_put_channel(dacp, 0U, dacp->config->init);
#else
dacp->params->dac->CR = DAC_CR_EN2 | DAC_CR_EN1;
- dacp->params->dac->DHR12RD = 0U;
+ dac_lld_put_channel(dacp, 0U, dacp->config->init);
+ dac_lld_put_channel(dacp, 1U, dacp->config->init);
#endif
}
}
diff --git a/os/hal/ports/STM32/LLD/DACv1/dac_lld.h b/os/hal/ports/STM32/LLD/DACv1/dac_lld.h index ddfafc256..a62852c51 100644 --- a/os/hal/ports/STM32/LLD/DACv1/dac_lld.h +++ b/os/hal/ports/STM32/LLD/DACv1/dac_lld.h @@ -365,6 +365,10 @@ typedef struct { typedef struct {
/* End of the mandatory fields.*/
/**
+ * @brief Initial output on DAC channels.
+ */
+ dacsample_t init;
+ /**
* @brief DAC data holding register mode.
*/
dacdhrmode_t datamode;
|