Minor fixes.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Sep 2011 12:51:16 +0000 (12:51 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Sep 2011 12:51:16 +0000 (12:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5126 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/hsmci_sam3.c
bertos/cpu/cortex-m3/drv/hsmci_sam3.h

index a4960fb51fb5a1fce6d88adcaad3071839f60ec9..b0c0ad0af522693a3afc08a548ee997352e4298d 100644 (file)
@@ -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;
 }
index 322e36c45fde91a8a37a63b87faee12d2667f007..cfb6e4cd5a9837e7a954dea3aaf28b8ca7ddde42 100644 (file)
@@ -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)