static int hexMode = HEXMODE;
-static const char trbcmd_version[] = "$Revision: 2.68 $";
+static const char trbcmd_version[] = "$Revision: 2.69 $";
#define BACKLOG 10
static uint16_t tcp_port = 55555;
void usage(const char *progName)
{
- fprintf(stdout, "Usage: %s [-h] [-f script-file] [-n number] [-d level] "
- "[-H] [-V] <COMMAND>\n", progName);
+ fprintf(stdout, "Usage: %s [-h] [-f script-file] [-n number] [-s time] "
+ "[-d level] [-H] [-V] <COMMAND>\n", progName);
fprintf(stdout, "Options:\n");
fprintf(stdout, " -h give this help\n");
fprintf(stdout, " -f execute commands given in script-file\n");
fprintf(stdout, " -n repeat COMMAND number times, -1 = endless loop\n");
+ fprintf(stdout,
+ " -s only if running in -n mode, "
+ "sleep time in useconds (usleep)\n");
fprintf(stdout,
" -M turn on HighMemoryMode (maximum usage is 20MByte, default: "
"3MByte)\n");
uint16_t trb_address = 0;
uint16_t reg_address = 0;
int loop = 1;
+ int sleepTime = 0;
int loopCtr = 0;
uint16_t trgCtr = 0; /* counter for the %ctr option */
int opt;
case 'n':
loop = strtol(optarg, NULL, 0);
break;
+ case 's':
+ sleepTime = strtol(optarg, NULL, 0);
+ break;
case 'd':
trb_debug = strtoul(optarg, NULL, 0);
break;
} /* End script-file-loop */
trgCtr++;
+
+ if (sleepTime > 0) {
+ usleep(sleepTime);
+ }
} /* End repeat-loop */
/* Cleanup */