experiment: add proto call to read latency from reg

parent 82ba0a2b
......@@ -1192,6 +1192,7 @@ static int ertm_process_psnmp(struct uart_packet *rx_pkt, struct uart_packet *tx
struct ertm14_protocol_op *op;
struct ertm14_version_info *ver;
uint8_t *fver, mode;
uint32_t *latency;
/* return board config in case of bad opcode */
if ((op = get_proto_op(opcode)) == NULL)
......@@ -1257,7 +1258,10 @@ static int ertm_process_psnmp(struct uart_packet *rx_pkt, struct uart_packet *tx
} else if (mode == WRC_MODE_UNKNOWN)
wrc_ptp_stop();
break;
case ertm14_get_streamers_latency:
latency = (uint32_t *)&tx_pkt->payload[op->offset2];
*latency = streamers_get_rx_latency();
break;
case 0x5a:
tx_pkt->length = rx_pkt->length;
tx_pkt->length = 1; /* no time to reply */
......
......@@ -19,6 +19,7 @@
#define ertm14_get_sensors 0x20
#define ertm14_get_version_info 0x21
#define ertm14_get_fpga_info 0x22
#define ertm14_get_streamers_latency 0x23
static struct ertm14_protocol_op {
int8_t opcode;
......@@ -104,6 +105,13 @@ static struct ertm14_protocol_op {
.offset2 = 1,
.length2 = 0,
},
{
.opcode = ertm14_get_streamers_latency,
.offset1 = 1,
.length1 = 0,
.offset2 = 0,
.length2 = sizeof(uint32_t),
},
{
.opcode = -1,
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment