aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
diff options
context:
space:
mode:
authorMichael Walker <walkerstop@gmail.com>2018-05-02 03:37:31 -0700
committerMichael Walker <walkerstop@gmail.com>2018-05-02 03:37:31 -0700
commitcd7559268dcc2da5f2b1f3872e6baa1cff1d5476 (patch)
tree0cf31de069f9df06a13743eab4e1879f05ce9c12 /os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
parent4d7ccdd1fce0c95c57129b80c81fab829daf9f99 (diff)
parent457afa6202fe9f8e6accb65411629172bb32c41b (diff)
downloadChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.tar.gz
ChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.tar.bz2
ChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.zip
Merge branch 'master' into mike
Diffstat (limited to 'os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c')
-rw-r--r--os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
index 6f710d4..da13ca5 100644
--- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
+++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
@@ -15,7 +15,7 @@
*/
/**
- * @file fsmc_sram.c
+ * @file hal_fsmc_sram.c
* @brief SRAM Driver subsystem low level driver source.
*
* @addtogroup SRAM
@@ -128,9 +128,9 @@ void fsmcSramStart(SRAMDriver *sramp, const SRAMConfig *cfgp) {
"invalid state");
if (sramp->state == SRAM_STOP) {
- sramp->sram->BCR = cfgp->bcr | FSMC_BCR_MBKEN;
sramp->sram->BTR = cfgp->btr;
sramp->sram->BWTR = cfgp->bwtr;
+ sramp->sram->BCR = cfgp->bcr | FSMC_BCR_MBKEN;
sramp->state = SRAM_READY;
}
}
@@ -145,7 +145,16 @@ void fsmcSramStart(SRAMDriver *sramp, const SRAMConfig *cfgp) {
void fsmcSramStop(SRAMDriver *sramp) {
if (sramp->state == SRAM_READY) {
- sramp->sram->BCR &= ~FSMC_BCR_MBKEN;
+ uint32_t mask = FSMC_BCR_MBKEN;
+#if (defined(STM32F427xx) || defined(STM32F437xx) || \
+ defined(STM32F429xx) || defined(STM32F439xx) || \
+ defined(STM32F745xx) || defined(STM32F746xx) || \
+ defined(STM32F756xx) || defined(STM32F767xx) || \
+ defined(STM32F769xx) || defined(STM32F777xx) || \
+ defined(STM32F779xx))
+ mask |= FSMC_BCR_CCLKEN;
+#endif
+ sramp->sram->BCR &= ~mask;
sramp->state = SRAM_STOP;
}
}