SBW: fix TCLK bullshit

This commit is contained in:
Triss 2022-07-24 01:40:24 +02:00
parent c7ec7a1752
commit 61b8b97263
2 changed files with 9 additions and 9 deletions

View File

@ -92,11 +92,11 @@ PUBLIC sbw_tclk_burst:
nop side 0 ; target reads TMS at falling edge nop side 0 ; target reads TMS at falling edge
mov pins, y side 0 ; during low phase, prepare TCLK mov pins, y side 0 ; during low phase, prepare TCLK
; tdi slot: ; tdi slot:
nop side 1 [12] ; wait a bit nop side 1 [6] ; wait a bit
burst_loop: burst_loop:
;PUBLIC sbw_tclk_burst_loadbearing_insn: ;PUBLIC sbw_tclk_burst_loadbearing_insn:
out pins, 1 side 1 [12] ; in the middle of TDI hiphase: do TCLK out pins, 1 side 1 [6] ; in the middle of TDI hiphase: do TCLK
jmp x--, burst_loop side 1 [12] jmp x--, burst_loop side 1 [6]
nop side 0 [1] ; need a low clock edge for TDO nop side 0 [1] ; need a low clock edge for TDO
; tdo slot: ; tdo slot:
set pindirs, 0 side 1 [1] set pindirs, 0 side 1 [1]

View File

@ -300,7 +300,7 @@ void sbw_clrset_tclk(bool value) {
void sbw_tclk_burst(uint32_t ncyc) { void sbw_tclk_burst(uint32_t ncyc) {
//sbw_pio_loadbearing_set_outpins(PINOUT_SBW_PIO); //sbw_pio_loadbearing_set_outpins(PINOUT_SBW_PIO);
uint32_t txremain = ((ncyc + 7) >> 3) * 2; uint32_t txremain = ((ncyc + 7) >> 3) * 2 - 1;
// MSB-first // MSB-first
uint8_t pattern = last_tclk ? 0x55 : 0xaa; uint8_t pattern = last_tclk ? 0x55 : 0xaa;