From 90f832679c659c669bd468cc49355df84445d905 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Feb 2014 16:03:30 +0000 Subject: Fixed bug #464. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6674 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 3 +++ os/hal/platforms/STM32/sdc_lld.h | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'os') 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 /** -- cgit v1.2.3