lattice: rework program_extFlash method to uses new mcsParser features when extension == mcs
This commit is contained in:
parent
3706236b43
commit
63a42344bc
|
|
@ -891,7 +891,6 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
printInfo("Parse file ", false);
|
printInfo("Parse file ", false);
|
||||||
if (_bit->parse() == EXIT_FAILURE) {
|
if (_bit->parse() == EXIT_FAILURE) {
|
||||||
printError("FAIL");
|
printError("FAIL");
|
||||||
|
|
@ -917,8 +916,13 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_file_extension == "mcs") {
|
||||||
|
McsParser *parser = (McsParser *)_bit;
|
||||||
|
ret = SPIInterface::write(parser->getRecords(), unprotect_flash, true);
|
||||||
|
} else {
|
||||||
ret = SPIInterface::write(offset, _bit->getData(), _bit->getLength() / 8,
|
ret = SPIInterface::write(offset, _bit->getData(), _bit->getLength() / 8,
|
||||||
unprotect_flash);
|
unprotect_flash);
|
||||||
|
}
|
||||||
|
|
||||||
delete _bit;
|
delete _bit;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue