static int hexMode = HEXMODE;
-static const char trbcmd_version[] = "$Revision: 2.64 $";
+static const char trbcmd_version[] = "$Revision: 2.65 $";
#define BACKLOG 10
static uint16_t tcp_port = 55555;
/*******************************************/
uint32_t value = 0;
+#ifndef PEXOR
uint16_t reg_address = 0;
-
+#else
+ uint32_t reg_address = 0;
+#endif
if (cmdLen != 2) {
logError(ERROR, "Invalid command, try -h option\n");
return -1;
if (trb_debug > 0) {
fprintf(stderr,
- "Command: READ_FIFO_REGISTER:"
- "reg_address: 0x%04x\n", reg_address);
+ "Command: READ_FIFO_REGISTER: reg_address: "
+#ifndef PEXOR
+ "0x%04x "
+#else
+ "0x%08x ",
+#endif
+ "\n", reg_address);
}
if (fpga_register_read(reg_address, &value) == -1) {
trb_strerror());
return -1;
} else {
- fprintf(stdout, "0x%04x 0x%08x\n", reg_address, value);
+
+ fprintf(stdout,
+#ifndef PEXOR
+ "0x%04x "
+#else
+ "0x%08x "
+#endif
+ "0x%08x\n", reg_address, value);
}
} else if (strncmp(cmd[0], "W", CMD_SIZE) == 0) {
/*******************************************/
uint32_t value = 0;
+#ifndef PEXOR
uint16_t reg_address = 0;
-
+#else
+ uint32_t reg_address = 0;
+#endif
+
if (cmdLen != 3) {
logError(ERROR, "Invalid command, try -h option\n");
return -1;
}
-
+
reg_address = strtoul(cmd[1], NULL, hexMode == 1 ? 16 : 0);
value = strtoul(cmd[2], NULL, hexMode == 1 ? 16 : 0);
if (trb_debug > 0) {
+
fprintf(stderr,
"Command: WRITE_FIFO_REGISTER:"
- "reg_address: 0x%04x, "
+ "reg_address: "
+#ifndef PEXOR
+ "0x%04x, "
+#else
+ "0x%08x, "
+#endif
"value: 0x%08x\n", reg_address, value);
}
-
+
if (fpga_register_write(reg_address, value) == -1) {
logError(ERROR, "fpga_register_write failed\n");
return -1;