aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-08 16:03:30 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-08 16:03:30 +0000
commit90f832679c659c669bd468cc49355df84445d905 (patch)
tree0f2e00408e1289bdd420d2b2e3918430fb8d3ad2 /os
parent3a41c23cf7bf054da38545bcffac7e6e2cd8fcb4 (diff)
downloadChibiOS-90f832679c659c669bd468cc49355df84445d905.tar.gz
ChibiOS-90f832679c659c669bd468cc49355df84445d905.tar.bz2
ChibiOS-90f832679c659c669bd468cc49355df84445d905.zip
Fixed bug #464.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6674 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32/sdc_lld.c3
-rw-r--r--os/hal/platforms/STM32/sdc_lld.h9
2 files changed, 11 insertions, 1 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c
index 0ad164235..cc048a03b 100644
--- a/os/hal/platforms/STM32/sdc_lld.c
+++ b/os/hal/platforms/STM32/sdc_lld.c
@@ -391,6 +391,9 @@ void sdc_lld_start_clk(SDCDriver *sdcp) {
SDIO->CLKCR = STM32_SDIO_DIV_LS;
SDIO->POWER |= SDIO_POWER_PWRCTRL_0 | SDIO_POWER_PWRCTRL_1;
SDIO->CLKCR |= SDIO_CLKCR_CLKEN;
+
+ /* Clock activation delay.*/
+ chThdSleepMilliseconds(STM32_SDC_CLOCK_ACTIVATION_DELAY);
}
/**
diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h
index 8b01ba915..89ce3f49f 100644
--- a/os/hal/platforms/STM32/sdc_lld.h
+++ b/os/hal/platforms/STM32/sdc_lld.h
@@ -82,7 +82,14 @@
* @brief Read timeout in milliseconds.
*/
#if !defined(SDC_READ_TIMEOUT_MS) || defined(__DOXYGEN__)
-#define SDC_READ_TIMEOUT_MS 5
+#define SDC_READ_TIMEOUT_MS 25
+#endif
+
+/**
+ * @brief Card clock activation delay in milliseconds.
+ */
+#if !defined(STM32_SDC_CLOCK_ACTIVATION_DELAY) || defined(__DOXYGEN__)
+#define STM32_SDC_CLOCK_ACTIVATION_DELAY 10
#endif
/**