Commit 7a73c072 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

shell: add command to enable/disable phase tracking

parent db67ddf1
......@@ -25,6 +25,7 @@ int cmd_verbose(const char *args[]);
int cmd_sdb(const char *args[]);
int cmd_mac(const char *args[]);
int cmd_init(const char *args[]);
int cmd_ptrack(const char *args[]);
int cmd_env(const char *args[]);
int cmd_saveenv(const char *args[]);
......
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2013 CERN (www.cern.ch)
* Author: Grzegorz Daniluk <grzegorz.daniluk@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <string.h>
#include <wrc.h>
#include "shell.h"
#include "ptpd.h"
extern int wrc_phase_tracking;
int cmd_ptrack(const char *args[])
{
if (args[0] && !strcasecmp(args[0], "enable")) {
wr_servo_enable_tracking(1);
wrc_phase_tracking = 1;
}
else if (args[0] && !strcasecmp(args[0], "disable")) {
wr_servo_enable_tracking(0);
wrc_phase_tracking = 0;
}
mprintf("phase tracking %s\n", wrc_phase_tracking?"ON":"OFF");
return 0;
}
......@@ -58,6 +58,7 @@ static const struct shell_cmd cmds_list[] = {
{"time", cmd_time},
{"sfp", cmd_sfp},
{"init", cmd_init},
{"ptrack", cmd_ptrack},
#ifdef CONFIG_ETHERBONE
{"ip", cmd_ip},
#endif
......
......@@ -12,7 +12,8 @@ obj-y += \
shell/cmd_gui.o \
shell/cmd_sdb.o \
shell/cmd_mac.o \
shell/cmd_init.o
shell/cmd_init.o \
shell/cmd_ptrack.o
obj-$(CONFIG_ETHERBONE) += shell/cmd_ip.o
obj-$(CONFIG_PPSI_RUNTIME_VERBOSITY) += shell/cmd_verbose.o
......@@ -32,6 +32,7 @@
#include "wrc_ptp.h"
int wrc_ui_mode = UI_SHELL_MODE;
int wrc_phase_tracking = 1;
///////////////////////////////////
//Calibration data (from EEPROM if available)
......
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