Commit 90a4b7ea authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

ppsi verbosity can be set by shell cmd and the default is defined in Kconfig

Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 33e885d0
......@@ -112,4 +112,15 @@ config PPSI
Select this option for the ppsi engine. Warning: this option is
work in progress, may not work or not compile at all.
config PPSI_VERBOSITY
depends on PPSI
int "Default verbosity for PPSI"
help
This option makes you select the verbosity of PPSI at startup:
0 means silent
1 means normal verbosity messages
2 means more verbose messages
default 0
range 0 2
endchoice
......@@ -21,6 +21,7 @@ int cmd_mode(const char *args[]);
int cmd_calib(const char *args[]);
int cmd_time(const char *args[]);
int cmd_ip(const char *args[]);
int cmd_verbose(const char *args[]);
int cmd_sdb(const char *args[]);
int cmd_mac(const char *args[]);
int cmd_init(const char *args[]);
......
ppsi @ 3c8d3a81
Subproject commit fc001cb00e7c48f0b69002506480f7f36cf5d190
Subproject commit 3c8d3a813413f6fc0740efeca6a4bb405123eedb
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2012 GSI (www.gsi.de)
* Author: Wesley W. Terpstra <w.terpstra@gsi.de>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <wrc.h>
extern int pp_diag_verbosity;
int cmd_verbose(const char *args[])
{
int v;
v = args[0][0] - '0';
if (v < 0)
v = 0;
else if (v > 2)
v = 2;
pp_printf("PPSI verbosity set to %d\n", v);
pp_diag_verbosity = v;
return 0;
}
......@@ -60,6 +60,9 @@ static const struct shell_cmd cmds_list[] = {
{"init", cmd_init},
#ifdef CONFIG_ETHERBONE
{"ip", cmd_ip},
#endif
#ifdef CONFIG_PPSI
{"verbose", cmd_verbose},
#endif
{"mac", cmd_mac},
{"sdb", cmd_sdb},
......
......@@ -15,3 +15,4 @@ obj-y += \
shell/cmd_init.o
obj-$(CONFIG_ETHERBONE) += shell/cmd_ip.o
obj-$(CONFIG_PPSI) += shell/cmd_verbose.o
......@@ -25,7 +25,7 @@ extern struct pp_runtime_opts default_rt_opts;
static int ptp_enabled = 0, ptp_mode = WRC_MODE_UNKNOWN;
static struct pp_instance ppi_static;
int pp_diag_verbosity = 0;
int pp_diag_verbosity = CONFIG_PPSI_VERBOSITY;
/*ppi fields*/
static UInteger16 sent_seq_id[16];
......
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