Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 42bf625

Browse files
committed
remote: Refactored the handling for REMOTE_TDITDO_{NO,}TMS
1 parent e46412d commit 42bf625

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/remote.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ static void remote_packet_process_swd(unsigned i, char *packet)
171171
static void remote_packet_process_jtag(unsigned i, char *packet)
172172
{
173173
uint32_t MS;
174-
uint64_t DO;
174+
uint64_t DO = 0;
175175
size_t ticks;
176-
uint64_t DI;
176+
uint64_t DI = 0;
177177
jtag_dev_t jtag_dev;
178178
switch (packet[1]) {
179179
case REMOTE_INIT: /* JS = initialise ============================= */
@@ -218,11 +218,9 @@ static void remote_packet_process_jtag(unsigned i, char *packet)
218218
} else {
219219
ticks = remotehston(2, &packet[2]);
220220
DI = remotehston(-1, &packet[4]);
221-
jtag_proc.jtagtap_tdi_tdo_seq((void *)&DO, (packet[1] == REMOTE_TDITDO_TMS), (void *)&DI, ticks);
222-
223-
/* Mask extra bits on return value... */
224-
if (ticks < 64)
225-
DO &= (1LL << ticks) - 1;
221+
const uint8_t *const data_in = (uint8_t *)&DI;
222+
uint8_t *data_out = (uint8_t *)&DO;
223+
jtag_proc.jtagtap_tdi_tdo_seq(data_out, packet[1] == REMOTE_TDITDO_TMS, data_in, ticks);
226224

227225
remote_respond(REMOTE_RESP_OK, DO);
228226
}

0 commit comments

Comments
 (0)