Merge pull request #40 from rhgndf/gal60016002fix

Fix GAL6001/GAL6002 write PES
This commit is contained in:
ole00 2023-10-10 07:15:57 +01:00 committed by GitHub
commit 711da82260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1094,8 +1094,8 @@ static void writePes(void) {
setPV(1); setPV(1);
switch(gal) { switch(gal) {
GAL6001: case GAL6001:
GAL6002: case GAL6002:
setRow(0); setRow(0);
sendBits(20, 0); sendBits(20, 0);
for (rbit = 0; rbit < 64; rbit++) { for (rbit = 0; rbit < 64; rbit++) {
@ -2232,46 +2232,46 @@ static void printJedec()
} }
} }
} }
Serial.print(F(" ")); Serial.print(' ');
printFormatedNumberHex2(n); printFormatedNumberHex2(n);
} }
Serial.println(F("*")); Serial.println('*');
// UES in bit form // UES in bit form
Serial.print(F("L")); Serial.print('L');
printFormatedNumberDec4(k); printFormatedNumberDec4(k);
Serial.print(F(" ")); Serial.print(' ');
for(j = 0; j < 8 * galinfo[gal].uesbytes; j++) { for(j = 0; j < 8 * galinfo[gal].uesbytes; j++) {
if (getFuseBit(k++)) { if (getFuseBit(k++)) {
Serial.print(F("1")); Serial.print('1');
} else { } else {
Serial.print(F("0")); Serial.print('0');
} }
} }
Serial.println(F("*")); Serial.println('*');
// CFG bits // CFG bits
if (k < galinfo[gal].fuses) { if (k < galinfo[gal].fuses) {
Serial.print(F("L")); Serial.print('L');
printFormatedNumberDec4(k); printFormatedNumberDec4(k);
Serial.print(F(" ")); Serial.print(' ');
while( k < galinfo[gal].fuses) { while( k < galinfo[gal].fuses) {
if (getFuseBit(k++)) { if (getFuseBit(k++)) {
Serial.print(F("1")); Serial.print('1');
} else { } else {
Serial.print(F("0")); Serial.print('0');
} }
} }
//ATF16V8C //ATF16V8C
if (apdFuse) { if (apdFuse) {
Serial.print(F("1")); Serial.print('1');
setFuseBit(k); // set for correct check-sum calculation setFuseBit(k); // set for correct check-sum calculation
} }
Serial.println(F("*")); Serial.println('*');
} else if (apdFuse) { //ATF22V10C } else if (apdFuse) { //ATF22V10C
Serial.print(F("L")); Serial.print('L');
printFormatedNumberDec4(k); printFormatedNumberDec4(k);
Serial.println(F(" 1*")); Serial.println(F(" 1*"));
setFuseBit(k); // set for correct check-sum calculation setFuseBit(k); // set for correct check-sum calculation
@ -2279,14 +2279,14 @@ static void printJedec()
Serial.print(F("N PES")); Serial.print(F("N PES"));
for(i = 0; i < galinfo[gal].pesbytes; i++) { for(i = 0; i < galinfo[gal].pesbytes; i++) {
Serial.print(F(" ")); Serial.print(' ');
printFormatedNumberHex2(pes[i]); printFormatedNumberHex2(pes[i]);
} }
Serial.println(F("*")); Serial.println('*');
Serial.print(F("C")); Serial.print('C');
printFormatedNumberHex4(checkSum(galinfo[gal].fuses + apdFuse)); printFormatedNumberHex4(checkSum(galinfo[gal].fuses + apdFuse));
Serial.println(); Serial.println();
Serial.println(F("*")); Serial.println('*');
} }
// helper print function to save RAM space // helper print function to save RAM space