URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 198 |
Rev 199 |
Line 173... |
Line 173... |
if (!diskReady()) {
|
if (!diskReady()) {
|
return 0;
|
return 0;
|
}
|
}
|
*DISK_SCT = sector;
|
*DISK_SCT = sector;
|
*DISK_CNT = 1;
|
*DISK_CNT = 1;
|
|
*DISK_CTRL = *DISK_CTRL & ~(DISK_CTRL_DONE | DISK_CTRL_ERR);
|
*DISK_CTRL = *DISK_CTRL | DISK_CTRL_STRT;
|
*DISK_CTRL = *DISK_CTRL | DISK_CTRL_STRT;
|
while ((*DISK_CTRL & DISK_CTRL_DONE) == 0) ;
|
while ((*DISK_CTRL & DISK_CTRL_DONE) == 0) ;
|
if (*DISK_CTRL & DISK_CTRL_ERR) {
|
if (*DISK_CTRL & DISK_CTRL_ERR) {
|
return 0;
|
return 0;
|
}
|
}
|
Line 197... |
Line 198... |
|
|
wrong = 0;
|
wrong = 0;
|
corrupted = 0;
|
corrupted = 0;
|
for (check = 0; check < numChecks; check++) {
|
for (check = 0; check < numChecks; check++) {
|
sectorRequ = nextRandomSector(NUM_SECTORS);
|
sectorRequ = nextRandomSector(NUM_SECTORS);
|
//----------------------------------------------
|
|
if (numChecks == 1) {
|
|
sectorRequ = 0x14001;
|
|
}
|
|
//----------------------------------------------
|
|
if (!readSector(sectorRequ, buffer)) {
|
if (!readSector(sectorRequ, buffer)) {
|
error("cannot read disk");
|
error("cannot read disk");
|
}
|
}
|
sectorRead = buffer[0];
|
sectorRead = buffer[0];
|
if (sectorRead != sectorRequ) {
|
if (sectorRead != sectorRequ) {
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.