Modified Verify function
It will only report individual addresses if there are errors Gives totals after completion Is faster (if there are no errors due to serial communication)
This commit is contained in:
1 parent
c60112e86a
commit
08ab129263
1 file changed
+27
-10
@@ -222,13 +222,13 @@ int xorf = xora ^ xorb;
|
|||||||
return invertbit(xorf);
|
return invertbit(xorf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void readportanalog(char port)
|
float readportanalog(char port)
|
||||||
{
|
{
|
||||||
|
|
||||||
int value = analogRead(port);
|
int value = analogRead(port);
|
||||||
float voltage = value * (5.0 / 1023.0);
|
float voltage = value * (5.0 / 1023.0);
|
||||||
Serial.print(voltage);
|
//Serial.print(voltage);
|
||||||
|
return(voltage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clk68k(int count)
|
void clk68k(int count)
|
||||||
@@ -307,22 +307,39 @@ void writesecret()
|
|||||||
|
|
||||||
void dataverifydo()
|
void dataverifydo()
|
||||||
{
|
{
|
||||||
|
int ok = 0, fail = 0;
|
||||||
verifysecret();
|
verifysecret();
|
||||||
|
|
||||||
digitalWrite(RW, HIGH); digitalWrite(AD1, HIGH); // activate D0 INPUT
|
digitalWrite(RW, HIGH); digitalWrite(AD1, HIGH); // activate D0 INPUT
|
||||||
pinMode(D0, INPUT);
|
pinMode(D0, INPUT);
|
||||||
|
|
||||||
|
p("Verifying, please wait\r\n");
|
||||||
for (int c=0; c <= 8191; c++) {
|
for (int c=0; c <= 8191; c++) {
|
||||||
p(" Addr: "); Serial.print(c);
|
float voltage = readportanalog(D0);
|
||||||
p(" Read volts: "); readportanalog(D0);
|
|
||||||
cByte = pgm_read_byte_near(EncryptionKey + c);
|
cByte = pgm_read_byte_near(EncryptionKey + c);
|
||||||
p(" Config Parity: "); Serial.print(parity(cByte));
|
if (parity(cByte) != digitalRead(D0))
|
||||||
p(" Chip Parity: "); Serial.print(digitalRead(D0));
|
{
|
||||||
if (parity(cByte) != digitalRead(D0)) {p(" NO MATCH");}
|
p(" Addr: "); Serial.print(c);
|
||||||
p("\r\n");
|
p(" Read volts: "); Serial.print(voltage);
|
||||||
|
p(" Config Parity: "); Serial.print(parity(cByte));
|
||||||
|
p(" Chip Parity: "); Serial.print(digitalRead(D0));
|
||||||
|
p(" NO MATCH\r\n");
|
||||||
|
fail++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ok ++;
|
||||||
digitalWrite(AS, HIGH); digitalWrite(AS, LOW);
|
digitalWrite(AS, HIGH); digitalWrite(AS, LOW);
|
||||||
}
|
}
|
||||||
|
if(!fail)
|
||||||
|
{
|
||||||
|
p("\r\nVerify OK, Correct Bytes: "); Serial.print(ok);
|
||||||
|
p("\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p("\r\nVerify FAILED, Errors "); Serial.print(fail);
|
||||||
|
p("\r\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void datawritedo()
|
void datawritedo()
|
||||||
|
|||||||
Reference in new issue
Block a user