remote: Implemented support for using the new jtagtap_cycle call

This commit is contained in:
dragonmux 2022-07-18 01:25:10 +01:00 committed by Piotr Esden-Tempski
parent 1b39173780
commit 2bfd84d1b2
2 changed files with 19 additions and 6 deletions

View File

@ -184,7 +184,7 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
{
uint32_t MS;
uint64_t DO;
uint8_t ticks;
size_t ticks;
uint64_t DI;
jtag_dev_t jtag_dev;
switch (packet[1]) {
@ -213,6 +213,15 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
}
break;
case REMOTE_CYCLE: { /* JC = clock cycle ============================ */
ticks = remotehston(8, &packet[4]);
const bool tms = packet[2] != '0';
const bool tdi = packet[3] != '0';
jtag_proc.jtagtap_cycle(tms, tdi, ticks);
remote_respond(REMOTE_RESP_OK, 0);
break;
}
case REMOTE_TDITDO_TMS: /* JD = TDI/TDO ========================================= */
case REMOTE_TDITDO_NOTMS:
@ -235,8 +244,8 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
if (i != 4)
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
else {
uint32_t dat = jtag_proc.jtagtap_next(packet[2] == '1', packet[3] == '1');
remote_respond(REMOTE_RESP_OK, dat);
const bool tdo = jtag_proc.jtagtap_next(packet[2] == '1', packet[3] == '1');
remote_respond(REMOTE_RESP_OK, tdo ? 1U : 0U);
}
break;

View File

@ -24,7 +24,7 @@
#include <inttypes.h>
#include "general.h"
#define REMOTE_HL_VERSION 1
#define REMOTE_HL_VERSION 2
/*
* Commands to remote end, and responses
@ -65,6 +65,7 @@
#define REMOTE_START 'A'
#define REMOTE_TDITDO_TMS 'D'
#define REMOTE_TDITDO_NOTMS 'd'
#define REMOTE_CYCLE 'c'
#define REMOTE_IN_PAR 'I'
#define REMOTE_FREQ_SET 'F'
#define REMOTE_FREQ_GET 'f'
@ -142,6 +143,9 @@
#define REMOTE_JTAG_TDIDO_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, '%', 'c', \
'%','0','2','x','%','l', 'x', REMOTE_EOM, 0 }
#define REMOTE_JTAG_CYCLE_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_CYCLE, '%', 'u', '%', 'u', \
'%', '0', '8', 'x', REMOTE_EOM, 0 }
#define REMOTE_JTAG_NEXT (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_NEXT, \
'%','c','%','c',REMOTE_EOM, 0 }
/* HL protocol elements */