From: Greg Davill Date: Sun, 20 Sep 2020 10:30:02 +0000 (+0930) Subject: sram mode: don't transmit trailing invalid bytes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1bbae8d1fdcdf87163c85faeb523ba6b30fb1257;p=ecpprog.git sram mode: don't transmit trailing invalid bytes --- diff --git a/ecpprog/ecpprog.c b/ecpprog/ecpprog.c index 8a5724e..3969889 100644 --- a/ecpprog/ecpprog.c +++ b/ecpprog/ecpprog.c @@ -1024,12 +1024,12 @@ int main(int argc, char **argv) if (verbose) fprintf(stderr, "sending %d bytes.\n", rc); - for(int i = 0; i < len; i++){ + for(int i = 0; i < rc; i++){ buffer[i] = bit_reverse(buffer[i]); } jtag_go_to_state(STATE_CAPTURE_DR); - jtag_tap_shift(buffer, buffer, len*8, false); + jtag_tap_shift(buffer, buffer, rc*8, false); } ecp_jtag_cmd(ISC_DISABLE);