Commit 7a1a6681 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

tools/fmc-fdelay-pulse: make output channel option mandatory.

This fixes a potentially very dangerous behaviour: previously the output was defaulted to channel 1 and
running fmc-fdelay-pulse with no parameters by unaware user would result with generation of a 10 Hz
waveform on output 1.
parent 341b9a11
......@@ -28,6 +28,7 @@ void help(char *name)
" -p pulse per seconds (sets -D -T -w)\n"
" -1 10MHz (sets -D -T -w)\n"
" -v verbose (report action)\n");
fprintf(stderr,"By default, the tool generates a continuous train of pulses (10 Hz frequency) on a given output.\n");
exit(1);
}
......@@ -211,7 +212,7 @@ int main(int argc, char **argv)
int nboards;
int i, opt, index = -1, dev = -1;
/* our parameters */
int count = 0, channel = 1;
int count = 0, channel = -1;
int trigger_wait = 0, verbose = 0;
struct fdelay_pulse p;
......@@ -342,6 +343,12 @@ int main(int argc, char **argv)
exit(1);
}
if(channel < 0)
{
fprintf(stderr, "%s: no channel specified (-o option missing).\n", argv[0]);
exit(1);
}
/* Final fixes: if reltime in pulse mode, add current time */
if (p.mode == FD_OUT_MODE_PULSE && p.start.utc == 0) {
struct fdelay_time current_board_time;
......
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