gowin: avoid multiple status register access
This commit is contained in:
parent
01d6244a0f
commit
0dcd851187
|
|
@ -657,9 +657,10 @@ bool Gowin::writeSRAM(const uint8_t *data, int length)
|
||||||
send_command(CONFIG_DISABLE); // config disable
|
send_command(CONFIG_DISABLE); // config disable
|
||||||
send_command(NOOP); // noop
|
send_command(NOOP); // noop
|
||||||
|
|
||||||
|
uint32_t status_reg = readStatusReg();
|
||||||
if (_verbose)
|
if (_verbose)
|
||||||
displayReadReg("after write sram", readStatusReg());
|
displayReadReg("after write sram", status_reg);
|
||||||
if (readStatusReg() & STATUS_DONE_FINAL) {
|
if (status_reg & STATUS_DONE_FINAL) {
|
||||||
printSuccess("DONE");
|
printSuccess("DONE");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -780,9 +781,11 @@ bool Gowin::eraseSRAM()
|
||||||
printError("FAIL");
|
printError("FAIL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t status_reg = readStatusReg();
|
||||||
if (_verbose)
|
if (_verbose)
|
||||||
displayReadReg("after erase sram", readStatusReg());
|
displayReadReg("after erase sram", status_reg);
|
||||||
if (readStatusReg() & STATUS_DONE_FINAL) {
|
if (status_reg & STATUS_DONE_FINAL) {
|
||||||
printError("FAIL");
|
printError("FAIL");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue