From 5bf8282a6c67268fd97cb7e8f6a1a6a52ddcc532 Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 30 Sep 2011 12:51:16 +0000 Subject: [PATCH] Minor fixes. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5126 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/drv/hsmci_sam3.c | 10 +++++----- bertos/cpu/cortex-m3/drv/hsmci_sam3.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bertos/cpu/cortex-m3/drv/hsmci_sam3.c b/bertos/cpu/cortex-m3/drv/hsmci_sam3.c index a4960fb5..b0c0ad0a 100644 --- a/bertos/cpu/cortex-m3/drv/hsmci_sam3.c +++ b/bertos/cpu/cortex-m3/drv/hsmci_sam3.c @@ -88,16 +88,16 @@ bool hsmci_sendCmd(uint8_t index, uint32_t argument, uint32_t reply_type) HSMCI_ARGR = argument; HSMCI_CMDR = index | reply_type | BV(HSMCI_CMDR_MAXLAT); - uint32_t status = HSMCI_SR; - while (!(status & BV(HSMCI_SR_CMDRDY))) - { + uint32_t status; + do { + status = HSMCI_SR; + if (status & HSMCI_RESP_ERROR_MASK) return status; cpu_relax(); - status = HSMCI_SR; - } + } while (!(status & BV(HSMCI_SR_CMDRDY))); return 0; } diff --git a/bertos/cpu/cortex-m3/drv/hsmci_sam3.h b/bertos/cpu/cortex-m3/drv/hsmci_sam3.h index 322e36c4..cfb6e4cd 100644 --- a/bertos/cpu/cortex-m3/drv/hsmci_sam3.h +++ b/bertos/cpu/cortex-m3/drv/hsmci_sam3.h @@ -50,7 +50,7 @@ #define HSMCI_INIT_SPEED 400000 -#define HSMCI_HIGH_SPEED 25000000 +#define HSMCI_HIGH_SPEED 21000000 #define HSMCI_HS_MODE BV(0) -- 2.25.1