hosted/ftdi: Fix bad length calculation in MPSSE case of swdptap_seq_in()
This commit is contained in:
parent
266fe17461
commit
6a9b2b8224
|
@ -305,7 +305,10 @@ static uint32_t swdptap_seq_in(int ticks)
|
||||||
if (do_mpsse) {
|
if (do_mpsse) {
|
||||||
uint8_t DO[4];
|
uint8_t DO[4];
|
||||||
libftdi_jtagtap_tdi_tdo_seq(DO, 0, NULL, ticks);
|
libftdi_jtagtap_tdi_tdo_seq(DO, 0, NULL, ticks);
|
||||||
for (int i = 0; i < (ticks >> 3) + (ticks & 7)? 1: 0; i++) {
|
int bytes = ticks >> 3;
|
||||||
|
if (ticks & 7)
|
||||||
|
bytes++;
|
||||||
|
for (int i = 0; i < bytes; i++) {
|
||||||
result |= DO[i] << (8 * i);
|
result |= DO[i] << (8 * i);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue