git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2993 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2011-05-22 07:06:19 +00:00
parent bf5a88b425
commit 6d58148a52
1 changed files with 11 additions and 8 deletions

View File

@ -28,7 +28,7 @@ static const SDCConfig sdccfg = {
0
};
static uint8_t buf[SDC_BLOCK_SIZE * 2];
static uint8_t blkbuf[SDC_BLOCK_SIZE * 4];
/*
* Application entry point.
@ -53,15 +53,18 @@ int main(void) {
int i;
/* Repeated multiple reads.*/
for (i = 0; i < 5000; i++) {
if (sdcRead(&SDCD1, 0, buf, 2))
if (sdcRead(&SDCD1, 0, blkbuf, 4))
chSysHalt();
}
/* Repeated multiple write.*/
for (i = 0; i < 100; i++) {
if (sdcRead(&SDCD1, 0x10000, blkbuf, 4))
chSysHalt();
if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4))
chSysHalt();
if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4))
chSysHalt();
}
if (sdcRead(&SDCD1, 0x10000, buf, 2))
chSysHalt();
if (sdcWrite(&SDCD1, 0x10000, buf, 2))
chSysHalt();
if (sdcRead(&SDCD1, 0x10000, buf, 2))
chSysHalt();
if (sdcDisconnect(&SDCD1))
chSysHalt();
}