Skip to content

Commit 63a4234

Browse files
committed
lattice: rework program_extFlash method to uses new mcsParser features when extension == mcs
1 parent 3706236 commit 63a4234

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lattice.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,6 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash)
891891
return false;
892892
}
893893

894-
895894
printInfo("Parse file ", false);
896895
if (_bit->parse() == EXIT_FAILURE) {
897896
printError("FAIL");
@@ -917,8 +916,13 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash)
917916
}
918917
}
919918

920-
ret = SPIInterface::write(offset, _bit->getData(), _bit->getLength() / 8,
919+
if (_file_extension == "mcs") {
920+
McsParser *parser = (McsParser *)_bit;
921+
ret = SPIInterface::write(parser->getRecords(), unprotect_flash, true);
922+
} else {
923+
ret = SPIInterface::write(offset, _bit->getData(), _bit->getLength() / 8,
921924
unprotect_flash);
925+
}
922926

923927
delete _bit;
924928
return ret;

0 commit comments

Comments
 (0)