diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-12-26 09:54:11 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-12-26 09:54:11 +0000 |
commit | a00002ab53dc2e566b74fbe1b607a37e7e95a419 (patch) | |
tree | 949074edafbc880ed78f71d8c636b76f02848380 | |
parent | 70aee6011b8f5fc985140464623019f6d57af540 (diff) | |
download | ChibiOS-a00002ab53dc2e566b74fbe1b607a37e7e95a419.tar.gz ChibiOS-a00002ab53dc2e566b74fbe1b607a37e7e95a419.tar.bz2 ChibiOS-a00002ab53dc2e566b74fbe1b607a37e7e95a419.zip |
Fixed Bug #803
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9987 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c | 2 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.h | 4 | ||||
-rw-r--r-- | readme.txt | 2 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/DAC/main.c | 3 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/DAC/main.c | 3 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/DAC_DUAL/main.c | 3 | ||||
-rw-r--r-- | testhal/STM32/STM32L1xx/DAC/main.c | 3 |
7 files changed, 16 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 e63af050f..57c041064 100644 --- a/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c +++ b/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c @@ -249,6 +249,8 @@ void dac_lld_start(DACDriver *dacp) { channel = 1;
}
#endif
+ /* Copying user configuration into cr */
+ dacp->params->dac->CR = dacp->config->cr;
/* Enabling DAC in SW triggering mode initially, initializing data to
zero.*/
diff --git a/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.h b/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.h index e2fd7b363..e1f7c2dec 100644 --- a/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.h +++ b/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.h @@ -371,6 +371,10 @@ typedef struct { * @brief DAC data holding register mode.
*/
dacdhrmode_t datamode;
+ /**
+ * @brief DAC control register.
+ */
+ uint32_t cr;
} DACConfig;
/**
diff --git a/readme.txt b/readme.txt index 1ca997083..01a82b153 100644 --- a/readme.txt +++ b/readme.txt @@ -153,6 +153,8 @@ - RT: Merged RT4.
- NIL: Merged NIL2.
- NIL: Added STM32F7 demo.
+- HAL: Added CR field to DAC configuration in STM32 port (bug #803)
+ (backported to 16.1.6).
- HAL: Fixed wrong initialization for DACD4 in STM32 port (bug #802)
(backported to 16.1.6).
- HAL: Fixed tab instead of space in dac driver (bug #801)
diff --git a/testhal/STM32/STM32F3xx/DAC/main.c b/testhal/STM32/STM32F3xx/DAC/main.c index 4df3980fa..d7ccfc4af 100644 --- a/testhal/STM32/STM32F3xx/DAC/main.c +++ b/testhal/STM32/STM32F3xx/DAC/main.c @@ -89,7 +89,8 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { static const DACConfig dac1cfg1 = {
.init = 2047U,
- .datamode = DAC_DHRM_12BIT_RIGHT
+ .datamode = DAC_DHRM_12BIT_RIGHT,
+ .cr = 0
};
static const DACConversionGroup dacgrpcfg1 = {
diff --git a/testhal/STM32/STM32F4xx/DAC/main.c b/testhal/STM32/STM32F4xx/DAC/main.c index aafe85828..9a72ba0e0 100644 --- a/testhal/STM32/STM32F4xx/DAC/main.c +++ b/testhal/STM32/STM32F4xx/DAC/main.c @@ -89,7 +89,8 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { static const DACConfig dac1cfg1 = {
.init = 2047U,
- .datamode = DAC_DHRM_12BIT_RIGHT
+ .datamode = DAC_DHRM_12BIT_RIGHT,
+ .cr = 0
};
static const DACConversionGroup dacgrpcfg1 = {
diff --git a/testhal/STM32/STM32F4xx/DAC_DUAL/main.c b/testhal/STM32/STM32F4xx/DAC_DUAL/main.c index fd9e1b536..7ce676bf2 100644 --- a/testhal/STM32/STM32F4xx/DAC_DUAL/main.c +++ b/testhal/STM32/STM32F4xx/DAC_DUAL/main.c @@ -89,7 +89,8 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { static const DACConfig dac1cfg1 = {
.init = 2047U,
- .datamode = DAC_DHRM_12BIT_RIGHT_DUAL
+ .datamode = DAC_DHRM_12BIT_RIGHT_DUAL,
+ .cr = 0
};
static const DACConversionGroup dacgrpcfg1 = {
diff --git a/testhal/STM32/STM32L1xx/DAC/main.c b/testhal/STM32/STM32L1xx/DAC/main.c index f5d2041d0..fe4420a02 100644 --- a/testhal/STM32/STM32L1xx/DAC/main.c +++ b/testhal/STM32/STM32L1xx/DAC/main.c @@ -89,7 +89,8 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { static const DACConfig dac1cfg1 = {
.init = 2047U,
- .datamode = DAC_DHRM_12BIT_RIGHT
+ .datamode = DAC_DHRM_12BIT_RIGHT,
+ .cr = 0
};
static const DACConversionGroup dacgrpcfg1 = {
|