diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-24 12:05:41 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-24 12:05:41 +0000 |
commit | 933bace9f3125c0643685189e218df84c08f4501 (patch) | |
tree | 9b670bb0bfc147b4374e27e09dfcb7c13be800bf /os/hal | |
parent | c1c8096c9d2d10533bf3e120c19795261ca4f6a5 (diff) | |
download | ChibiOS-933bace9f3125c0643685189e218df84c08f4501.tar.gz ChibiOS-933bace9f3125c0643685189e218df84c08f4501.tar.bz2 ChibiOS-933bace9f3125c0643685189e218df84c08f4501.zip |
Fixed Bug #776.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9780 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c b/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c index 816929e81..c9ca8f8b0 100644 --- a/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c +++ b/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c @@ -288,7 +288,8 @@ void dac_lld_stop(DACDriver *dacp) { #if STM32_DAC_USE_DAC1_CH1
if (&DACD1 == dacp) {
- if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
+ if ((dacp->params->dac->CR & DAC_CR_EN1) == 0U) {
+
rccDisableDAC1(false);
}
}
@@ -296,7 +297,8 @@ void dac_lld_stop(DACDriver *dacp) { #if STM32_DAC_USE_DAC1_CH2
if (&DACD2 == dacp) {
- if ((dacp->params->dac->CR & DAC_CR_EN1) == 0U) {
+ if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
+
rccDisableDAC1(false);
}
}
@@ -304,7 +306,7 @@ void dac_lld_stop(DACDriver *dacp) { #if STM32_DAC_USE_DAC2_CH1
if (&DACD3 == dacp) {
- if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
+ if ((dacp->params->dac->CR & DAC_CR_EN1) == 0U) {
rccDisableDAC2(false);
}
}
@@ -312,7 +314,7 @@ void dac_lld_stop(DACDriver *dacp) { #if STM32_DAC_USE_DAC2_CH2
if (&DACD4 == dacp) {
- if ((dacp->params->dac->CR & DAC_CR_EN1) == 0U) {
+ if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
rccDisableDAC2(false);
}
}
@@ -345,9 +347,11 @@ void dac_lld_put_channel(DACDriver *dacp, *(&dacp->params->dac->DHR12R1 + dacp->params->dataoffset) = (uint32_t)sample;
#endif
}
+#if (STM32_HAS_DAC1_CH2 || STM32_HAS_DAC2_CH2)
else {
dacp->params->dac->DHR12R2 = (uint32_t)sample;
}
+#endif
break;
case DAC_DHRM_12BIT_LEFT:
#if STM32_DAC_DUAL_MODE
@@ -360,9 +364,11 @@ void dac_lld_put_channel(DACDriver *dacp, *(&dacp->params->dac->DHR12L1 + dacp->params->dataoffset) = (uint32_t)sample;
#endif
}
+#if (STM32_HAS_DAC1_CH2 || STM32_HAS_DAC2_CH2)
else {
dacp->params->dac->DHR12L2 = (uint32_t)sample;
}
+#endif
break;
case DAC_DHRM_8BIT_RIGHT:
#if STM32_DAC_DUAL_MODE
@@ -375,9 +381,11 @@ void dac_lld_put_channel(DACDriver *dacp, *(&dacp->params->dac->DHR8R1 + dacp->params->dataoffset) = (uint32_t)sample;
#endif
}
+#if (STM32_HAS_DAC1_CH2 || STM32_HAS_DAC2_CH2)
else {
dacp->params->dac->DHR8R2 = (uint32_t)sample;
}
+#endif
break;
default:
osalDbgAssert(false, "unexpected DAC mode");
|