usbBlaster: fix read bit align and don't potentially write when just set clk low
This commit is contained in:
parent
1345e6da6d
commit
a220226a9e
|
|
@ -260,8 +260,8 @@ int UsbBlaster::writeTDI(uint8_t *tx, uint8_t *rx, uint32_t len, bool end)
|
||||||
if (writeBit((rx)? &tmp:NULL, 1) < 0)
|
if (writeBit((rx)? &tmp:NULL, 1) < 0)
|
||||||
return -EXIT_FAILURE;
|
return -EXIT_FAILURE;
|
||||||
if (rx)
|
if (rx)
|
||||||
*rx_ptr |= ((tmp & 0x80) << (7 - nb_bit));
|
*rx_ptr = (tmp & 0x80) | ((*rx_ptr) >> 1);
|
||||||
_in_buf[_nb_bit++] = mask | mode;
|
_in_buf[_nb_bit++] = mask;
|
||||||
if (writeBit(NULL, 0) < 0)
|
if (writeBit(NULL, 0) < 0)
|
||||||
return -EXIT_FAILURE;
|
return -EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue