From 282f43823a0891a53b7368c56beed89f6ba1d9a7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 7 Aug 2014 11:47:30 +0000 Subject: [PATCH] Fixed bug #522. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7154 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/sdc_lld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/hal/ports/STM32/LLD/sdc_lld.c b/os/hal/ports/STM32/LLD/sdc_lld.c index 7b6310038..b5b223d72 100644 --- a/os/hal/ports/STM32/LLD/sdc_lld.c +++ b/os/hal/ports/STM32/LLD/sdc_lld.c @@ -486,7 +486,7 @@ bool sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = sta; + SDIO->ICR = sta & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL); if ((sta & (SDIO_STA_CTIMEOUT)) != 0) { sdc_lld_collect_errors(sdcp, sta); return HAL_FAILED; @@ -520,7 +520,7 @@ bool sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = sta; + SDIO->ICR = sta & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL); if ((sta & (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) != 0) { sdc_lld_collect_errors(sdcp, sta); return HAL_FAILED; @@ -555,7 +555,7 @@ bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = sta; + SDIO->ICR = sta & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL); if ((sta & (STM32_SDIO_STA_ERROR_MASK)) != 0) { sdc_lld_collect_errors(sdcp, sta); return HAL_FAILED;