diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-29 09:09:22 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-29 09:09:22 +0000 |
commit | 88e92b3fc3a14ec04780815b1061e680dfbb9777 (patch) | |
tree | 704bdc914abd1b403f0ea97ddb0e535552eea0ad /testhal | |
parent | a3239bf257f320ba2d85da27b23f16d058efbb96 (diff) | |
download | ChibiOS-88e92b3fc3a14ec04780815b1061e680dfbb9777.tar.gz ChibiOS-88e92b3fc3a14ec04780815b1061e680dfbb9777.tar.bz2 ChibiOS-88e92b3fc3a14ec04780815b1061e680dfbb9777.zip |
Improvements to the STM32 SDC driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3001 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/SDIO/main.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 8c5452ed7..9736f0268 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0
};
-static uint8_t blkbuf[SDC_BLOCK_SIZE * 4];
+static uint8_t blkbuf[SDC_BLOCK_SIZE * 4 + 1];
/*
* Application entry point.
@@ -51,12 +51,36 @@ int main(void) { sdcStart(&SDCD1, &sdccfg);
if (!sdcConnect(&SDCD1)) {
int i;
- /* Repeated multiple reads.*/
- for (i = 0; i < 5000; i++) {
+
+ /* Single aligned read.*/
+ if (sdcRead(&SDCD1, 0, blkbuf, 1))
+ chSysHalt();
+
+ /* Single unaligned read.*/
+ if (sdcRead(&SDCD1, 0, blkbuf + 1, 1))
+ chSysHalt();
+
+ /* Multiple aligned read.*/
+ if (sdcRead(&SDCD1, 0, blkbuf, 4))
+ chSysHalt();
+
+ /* Multiple unaligned read.*/
+ if (sdcRead(&SDCD1, 0, blkbuf + 1, 4))
+ chSysHalt();
+
+ /* Repeated multiple aligned reads.*/
+ for (i = 0; i < 1000; i++) {
if (sdcRead(&SDCD1, 0, blkbuf, 4))
chSysHalt();
}
- /* Repeated multiple write.*/
+
+ /* Repeated multiple unaligned reads.*/
+ for (i = 0; i < 1000; i++) {
+ if (sdcRead(&SDCD1, 0, blkbuf + 1, 4))
+ chSysHalt();
+ }
+
+ /* Repeated multiple aligned writes.*/
for (i = 0; i < 100; i++) {
if (sdcRead(&SDCD1, 0x10000, blkbuf, 4))
chSysHalt();
@@ -65,6 +89,17 @@ int main(void) { if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4))
chSysHalt();
}
+
+ /* Repeated multiple unaligned writes.*/
+ for (i = 0; i < 100; i++) {
+ if (sdcRead(&SDCD1, 0x10000, blkbuf + 1, 4))
+ chSysHalt();
+ if (sdcWrite(&SDCD1, 0x10000, blkbuf + 1, 4))
+ chSysHalt();
+ if (sdcWrite(&SDCD1, 0x10000, blkbuf + 1, 4))
+ chSysHalt();
+ }
+
if (sdcDisconnect(&SDCD1))
chSysHalt();
}
|