This commit is contained in:
Triss 2021-09-25 00:46:07 +02:00
parent 2cfeee3e5c
commit 9aeaea5d9f
1 changed files with 2 additions and 1 deletions

View File

@ -216,7 +216,8 @@ void JTAG_Sequence(uint32_t info, const uint8_t* tdi, uint8_t* tdo) {
uint8_t ov = *rx;
--rxremain;
//printf("rx %02x rem %lu smpc=%x\n", ov, rxremain, pio_sm_get_pc(PINOUT_JTAG_PIO_DEV, jtagsm));
if ((info & JTAG_SEQUENCE_TDO)) {
// avoid writing extra byte generated by final 'push' insn, would cause buffer ovf
if ((info & JTAG_SEQUENCE_TDO) && oi < bytelen) {
if (last_shift && oi == bytelen - 1) {
//printf("orig=%02x swap=%02x shamt=%lu result=%02x\n", ov, bitswap(ov), last_shift, bitswap(ov)>>last_shift);
tdo[oi] = bitswap(ov) >> last_shift;