From 2bf7b255b32e9ec7144804deb38e3abd49460303 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 12 Jun 2021 09:27:16 +0200 Subject: [PATCH] lattice: move directly to run_test_idle with last tx packet in program_mem --- src/lattice.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lattice.cpp b/src/lattice.cpp index a802aa9..9ae998e 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -222,23 +222,24 @@ bool Lattice::program_mem() uint8_t tmp[1024]; int size = 1024; + int next_state = Jtag::SHIFT_DR; ProgressBar progress("Loading", length, 50, _quiet); for (int i = 0; i < length; i += size) { progress.display(i); - if (length < i + size) + if (length < i + size) { size = length-i; + next_state = Jtag::RUN_TEST_IDLE; + } for (int ii = 0; ii < size; ii++) tmp[ii] = ConfigBitstreamParser::reverseByte(data[i+ii]); - _jtag->shiftDR(tmp, NULL, size*8, Jtag::SHIFT_DR); + _jtag->shiftDR(tmp, NULL, size*8, next_state); } - _jtag->set_state(Jtag::RUN_TEST_IDLE); - if (checkStatus(0, REG_STATUS_CNF_CHK_MASK)) progress.done(); else {