remote: Run clang-format on the JTAG and SWD packet processors

This commit is contained in:
dragonmux 2022-08-09 02:10:31 +01:00 committed by Piotr Esden-Tempski
parent dd0e99b0e6
commit e1007a98bb
1 changed files with 43 additions and 43 deletions

View File

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