File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -333,17 +333,18 @@ fn transfer<DEPS>(
333333fn shift_register_data < DEPS > (
334334 jtag : & mut impl Jtag < DEPS > ,
335335 mut data : u32 ,
336- mut clocks : u8 ,
336+ clock_cycles : u8 ,
337337 exit_shift : bool ,
338338) -> u32 {
339339 // All bits except last with TMS = 0
340340 let mut captured_dr = 0 ;
341+ let mut clocks = clock_cycles;
341342 while clocks > 1 {
342343 let bits = ( clocks - 1 ) . min ( 8 ) ;
343344
344345 let captured_byte = shift_tdi ( jtag, data as u8 , bits, false ) ;
345346 captured_dr >>= bits;
346- captured_dr |= ( captured_byte as u32 ) << ( 32 - bits) ;
347+ captured_dr |= ( captured_byte as u32 ) << ( clock_cycles - bits) ;
347348
348349 data >>= bits;
349350 clocks -= bits;
@@ -352,7 +353,7 @@ fn shift_register_data<DEPS>(
352353 // Last bit (with TMS = 1 if exit_shift)
353354 let captured_byte = shift_tdi ( jtag, data as u8 , 1 , exit_shift) ;
354355 captured_dr >>= 1 ;
355- captured_dr |= ( captured_byte as u32 ) << 31 ;
356+ captured_dr |= ( captured_byte as u32 ) << ( clock_cycles - 1 ) ;
356357
357358 captured_dr
358359}
You can’t perform that action at this time.
0 commit comments