git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6319 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
318c354f14
commit
e118266767
|
@ -93,27 +93,72 @@ void cmd_sdc(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
if ((strcmp(argv[0], "read") == 0) ||
|
if ((strcmp(argv[0], "read") == 0) ||
|
||||||
(strcmp(argv[0], "all") == 0)) {
|
(strcmp(argv[0], "all") == 0)) {
|
||||||
|
|
||||||
/* Single block read performance.*/
|
/* Single block read performance, aligned.*/
|
||||||
chprintf(chp, "Single block read performance: ");
|
chprintf(chp, "Single block aligned read performance: ");
|
||||||
start = chVTGetSystemTime();
|
start = chVTGetSystemTime();
|
||||||
end = start + MS2ST(1000);
|
end = start + MS2ST(1000);
|
||||||
n = 0;
|
n = 0;
|
||||||
do {
|
do {
|
||||||
if (blkRead(&SDCD1, startblk, buf, 1)) {
|
if (blkRead(&SDCD1, startblk, buf, 1)) {
|
||||||
chprintf(chp, "failed\r\n");
|
chprintf(chp, "failed\r\n");
|
||||||
break;
|
goto exittest;
|
||||||
}
|
}
|
||||||
chThdSleepMilliseconds(1);
|
|
||||||
n++;
|
n++;
|
||||||
} while (chVTIsSystemTimeWithin(start, end));
|
} while (chVTIsSystemTimeWithin(start, end));
|
||||||
chprintf(chp, "%D blocks per second\r\n", n);
|
chprintf(chp, "%D blocks/S, %D bytes/S\r\n", n, n * MMCSD_BLOCK_SIZE);
|
||||||
|
|
||||||
|
/* Multiple sequential blocks read performance, aligned.*/
|
||||||
|
chprintf(chp, "16 sequential blocks aligned read performance: ");
|
||||||
|
start = chVTGetSystemTime();
|
||||||
|
end = start + MS2ST(1000);
|
||||||
|
n = 0;
|
||||||
|
do {
|
||||||
|
if (blkRead(&SDCD1, startblk, buf, SDC_BURST_SIZE)) {
|
||||||
|
chprintf(chp, "failed\r\n");
|
||||||
|
goto exittest;
|
||||||
|
}
|
||||||
|
n += SDC_BURST_SIZE;
|
||||||
|
} while (chVTIsSystemTimeWithin(start, end));
|
||||||
|
chprintf(chp, "%D blocks/S, %D bytes/S\r\n", n, n * MMCSD_BLOCK_SIZE);
|
||||||
|
|
||||||
|
#if STM32_SDC_SDIO_UNALIGNED_SUPPORT
|
||||||
|
/* Single block read performance, unaligned.*/
|
||||||
|
chprintf(chp, "Single block unaligned read performance: ");
|
||||||
|
start = chVTGetSystemTime();
|
||||||
|
end = start + MS2ST(1000);
|
||||||
|
n = 0;
|
||||||
|
do {
|
||||||
|
if (blkRead(&SDCD1, startblk, buf + 1, 1)) {
|
||||||
|
chprintf(chp, "failed\r\n");
|
||||||
|
goto exittest;
|
||||||
|
}
|
||||||
|
n++;
|
||||||
|
} while (chVTIsSystemTimeWithin(start, end));
|
||||||
|
chprintf(chp, "%D blocks/S, %D bytes/S\r\n", n, n * MMCSD_BLOCK_SIZE);
|
||||||
|
|
||||||
|
/* Multiple sequential blocks read performance, unaligned.*/
|
||||||
|
chprintf(chp, "16 sequential blocks unaligned read performance: ");
|
||||||
|
start = chVTGetSystemTime();
|
||||||
|
end = start + MS2ST(1000);
|
||||||
|
n = 0;
|
||||||
|
do {
|
||||||
|
if (blkRead(&SDCD1, startblk, buf + 1, SDC_BURST_SIZE)) {
|
||||||
|
chprintf(chp, "failed\r\n");
|
||||||
|
goto exittest;
|
||||||
|
}
|
||||||
|
n += SDC_BURST_SIZE;
|
||||||
|
} while (chVTIsSystemTimeWithin(start, end));
|
||||||
|
chprintf(chp, "%D blocks/S, %D bytes/S\r\n", n, n * MMCSD_BLOCK_SIZE);
|
||||||
|
#endif /* STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((strcmp(argv[0], "write") == 0) ||
|
if ((strcmp(argv[0], "write") == 0) ||
|
||||||
(strcmp(argv[0], "all") == 0)) {
|
(strcmp(argv[0], "all") == 0)) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Card disconnect and command end.*/
|
/* Card disconnect and command end.*/
|
||||||
|
exittest:
|
||||||
sdcDisconnect(&SDCD1);
|
sdcDisconnect(&SDCD1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue