phc2sys: Add option to set step threshold.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2013-02-05 17:36:04 +01:00 committed by Richard Cochran
parent 6dc1b90306
commit 09fdc45220
2 changed files with 11 additions and 1 deletions

View File

@ -81,6 +81,12 @@ Specify the proportional constant of the PI controller. The default is 0.7.
.BI \-I " ki" .BI \-I " ki"
Specify the integral constant of the PI controller. The default is 0.3. Specify the integral constant of the PI controller. The default is 0.3.
.TP .TP
.BI \-S " step"
Specify the step threshold of the PI controller. It is the maximum offset that
the controller corrects by changing the clock frequency instead of stepping the
clock. The clock is always stepped on start. The value of 0.0 disables stepping
after the start. The default is 0.0.
.TP
.BI \-R " update-rate" .BI \-R " update-rate"
Specify the slave clock update rate when running in the direct synchronization Specify the slave clock update rate when running in the direct synchronization
mode. The default is 1 per second. mode. The default is 1 per second.

View File

@ -420,6 +420,7 @@ static void usage(char *progname)
" -i [iface] master clock by network interface\n" " -i [iface] master clock by network interface\n"
" -P [kp] proportional constant (0.7)\n" " -P [kp] proportional constant (0.7)\n"
" -I [ki] integration constant (0.3)\n" " -I [ki] integration constant (0.3)\n"
" -S [step] step threshold (disabled)\n"
" -R [rate] slave clock update rate in HZ (1)\n" " -R [rate] slave clock update rate in HZ (1)\n"
" -N [num] number of master clock readings per update (5)\n" " -N [num] number of master clock readings per update (5)\n"
" -O [offset] slave-master time offset (0)\n" " -O [offset] slave-master time offset (0)\n"
@ -448,7 +449,7 @@ int main(int argc, char *argv[])
/* Process the command line arguments. */ /* Process the command line arguments. */
progname = strrchr(argv[0], '/'); progname = strrchr(argv[0], '/');
progname = progname ? 1+progname : argv[0]; progname = progname ? 1+progname : argv[0];
while (EOF != (c = getopt(argc, argv, "c:d:hs:P:I:R:N:O:i:wv"))) { while (EOF != (c = getopt(argc, argv, "c:d:hs:P:I:S:R:N:O:i:wv"))) {
switch (c) { switch (c) {
case 'c': case 'c':
dst_clock.clkid = clock_open(optarg); dst_clock.clkid = clock_open(optarg);
@ -465,6 +466,9 @@ int main(int argc, char *argv[])
case 'I': case 'I':
configured_pi_ki = atof(optarg); configured_pi_ki = atof(optarg);
break; break;
case 'S':
configured_pi_offset = atof(optarg);
break;
case 'R': case 'R':
phc_rate = atoi(optarg); phc_rate = atoi(optarg);
break; break;