From 63a42344bc7bb9acc515edee298cce3ea0092566 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Wed, 17 Dec 2025 20:02:14 +0100 Subject: [PATCH] lattice: rework program_extFlash method to uses new mcsParser features when extension == mcs --- src/lattice.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lattice.cpp b/src/lattice.cpp index 5841261..a0b9b57 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -891,7 +891,6 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash) return false; } - printInfo("Parse file ", false); if (_bit->parse() == EXIT_FAILURE) { printError("FAIL"); @@ -917,8 +916,13 @@ bool Lattice::program_extFlash(unsigned int offset, bool unprotect_flash) } } - ret = SPIInterface::write(offset, _bit->getData(), _bit->getLength() / 8, + 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, unprotect_flash); + } delete _bit; return ret;