aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-29 09:09:22 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-29 09:09:22 +0000
commit88e92b3fc3a14ec04780815b1061e680dfbb9777 (patch)
tree704bdc914abd1b403f0ea97ddb0e535552eea0ad /testhal
parenta3239bf257f320ba2d85da27b23f16d058efbb96 (diff)
downloadChibiOS-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.c43
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();
}
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256