remote: Run clang-format on the JTAG and SWD packet processors
This commit is contained in:
parent
dd0e99b0e6
commit
e1007a98bb
54
src/remote.c
54
src/remote.c
|
@ -125,45 +125,45 @@ static void remotePacketProcessSWD(unsigned i, char *packet)
|
|||
|
||||
switch (packet[1]) {
|
||||
case REMOTE_INIT: /* SS = initialise =============================== */
|
||||
if (i==2) {
|
||||
if (i == 2) {
|
||||
remote_dp.dp_read = firmware_swdp_read;
|
||||
remote_dp.low_access = firmware_swdp_low_access;
|
||||
remote_dp.abort = firmware_swdp_abort;
|
||||
swdptap_init(&remote_dp);
|
||||
remote_respond(REMOTE_RESP_OK, 0);
|
||||
} else {
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_WRONGLEN);
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
||||
}
|
||||
break;
|
||||
|
||||
case REMOTE_IN_PAR: /* SI = In parity ============================= */
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
badParity = remote_dp.seq_in_parity(¶m, ticks);
|
||||
remote_respond(badParity?REMOTE_RESP_PARERR:REMOTE_RESP_OK,param);
|
||||
remote_respond(badParity ? REMOTE_RESP_PARERR : REMOTE_RESP_OK, param);
|
||||
break;
|
||||
|
||||
case REMOTE_IN: /* Si = In ======================================= */
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
param = remote_dp.seq_in(ticks);
|
||||
remote_respond(REMOTE_RESP_OK,param);
|
||||
remote_respond(REMOTE_RESP_OK, param);
|
||||
break;
|
||||
|
||||
case REMOTE_OUT: /* So= Out ====================================== */
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
param=remotehston(-1, &packet[4]);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
param = remotehston(-1, &packet[4]);
|
||||
remote_dp.seq_out(param, ticks);
|
||||
remote_respond(REMOTE_RESP_OK, 0);
|
||||
break;
|
||||
|
||||
case REMOTE_OUT_PAR: /* SO = Out parity ========================== */
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
param=remotehston(-1, &packet[4]);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
param = remotehston(-1, &packet[4]);
|
||||
remote_dp.seq_out_parity(param, ticks);
|
||||
remote_respond(REMOTE_RESP_OK, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_UNRECOGNISED);
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_UNRECOGNISED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -190,13 +190,13 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
|||
break;
|
||||
|
||||
case REMOTE_TMS: /* JT = TMS Sequence ============================ */
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
MS=remotehston(2,&packet[4]);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
MS = remotehston(2, &packet[4]);
|
||||
|
||||
if (i<4) {
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_WRONGLEN);
|
||||
if (i < 4) {
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
||||
} else {
|
||||
jtag_proc.jtagtap_tms_seq( MS, ticks);
|
||||
jtag_proc.jtagtap_tms_seq(MS, ticks);
|
||||
remote_respond(REMOTE_RESP_OK, 0);
|
||||
}
|
||||
break;
|
||||
|
@ -213,12 +213,12 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
|||
case REMOTE_TDITDO_TMS: /* JD = TDI/TDO ========================================= */
|
||||
case REMOTE_TDITDO_NOTMS:
|
||||
|
||||
if (i<5) {
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_WRONGLEN);
|
||||
if (i < 5) {
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
||||
} else {
|
||||
ticks=remotehston(2,&packet[2]);
|
||||
DI=remotehston(-1,&packet[4]);
|
||||
jtag_proc.jtagtap_tdi_tdo_seq((void *)&DO, (packet[1]==REMOTE_TDITDO_TMS), (void *)&DI, ticks);
|
||||
ticks = remotehston(2, &packet[2]);
|
||||
DI = remotehston(-1, &packet[4]);
|
||||
jtag_proc.jtagtap_tdi_tdo_seq((void *)&DO, (packet[1] == REMOTE_TDITDO_TMS), (void *)&DI, ticks);
|
||||
|
||||
/* Mask extra bits on return value... */
|
||||
if (ticks < 64)
|
||||
|
@ -239,13 +239,13 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
|||
|
||||
case REMOTE_ADD_JTAG_DEV: /* JJ = fill firmware jtag_devs */
|
||||
if (i < 22) {
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_WRONGLEN);
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
||||
} else {
|
||||
memset(&jtag_dev, 0, sizeof(jtag_dev));
|
||||
const uint32_t index = remotehston(2, &packet[ 2]);
|
||||
jtag_dev.dr_prescan = remotehston(2, &packet[ 4]);
|
||||
jtag_dev.dr_postscan = remotehston(2, &packet[ 6]);
|
||||
jtag_dev.ir_len = remotehston(2, &packet[ 8]);
|
||||
const uint32_t index = remotehston(2, &packet[2]);
|
||||
jtag_dev.dr_prescan = remotehston(2, &packet[4]);
|
||||
jtag_dev.dr_postscan = remotehston(2, &packet[6]);
|
||||
jtag_dev.ir_len = remotehston(2, &packet[8]);
|
||||
jtag_dev.ir_prescan = remotehston(2, &packet[10]);
|
||||
jtag_dev.ir_postscan = remotehston(2, &packet[12]);
|
||||
jtag_dev.current_ir = remotehston(8, &packet[14]);
|
||||
|
@ -255,7 +255,7 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
|||
break;
|
||||
|
||||
default:
|
||||
remote_respond(REMOTE_RESP_ERR,REMOTE_ERROR_UNRECOGNISED);
|
||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_UNRECOGNISED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue