Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
b0ede37f
Commit
b0ede37f
authored
Jan 15, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell: add cmd_pps
Signed-off-by:
Adam Wujek
<
adam.wujek@creotech.pl
>
parent
ff324578
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
1 deletion
+67
-1
Kconfig
Kconfig
+8
-0
cmd_pps.c
shell/cmd_pps.c
+50
-0
shell.c
shell/shell.c
+8
-1
shell.mk
shell/shell.mk
+1
-0
No files found.
Kconfig
View file @
b0ede37f
...
...
@@ -363,6 +363,14 @@ config LLDP
used by network devices for advertising their identity, capabilities,
and neighbors on local area network.
config CMD_PPS
depends on WR_NODE
boolean "Include PPS command"
default n
help
This enables pps command, which can be used to force PPS output
all the time for all clock classes.
#
# This is a set of configuration options that should not be changed by
# normal users. If the "developer" menu is used, the binary is tainted.
...
...
shell/cmd_pps.c
0 → 100644
View file @
b0ede37f
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2021 CERN (www.cern.ch)
* Author: Adam Wujek
*
* Released according to the GNU GPL, version 2 or any later version.
*/
/* Command: pps
Arguments:
force on|off - sets the behaviour of forcing PPS generation
<none> - dumps force PPS generation setting
Description: Enable disable generation of PPS all the time */
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <wrc.h>
#include <wrpc.h>
#include "shell.h"
#include "util.h"
#include "wrc_ptp.h"
char
*
pps_force_map
[]
=
{
[
pps_force_off
]
=
"off"
,
[
pps_force_on
]
=
"on"
,
};
static
int
cmd_pps
(
const
char
*
args
[])
{
if
(
!
strcasecmp
(
args
[
0
],
"force"
))
{
if
(
!
strcasecmp
(
args
[
1
],
"on"
))
{
wrc_pps_force
(
pps_force_on
);
}
else
if
(
!
strcasecmp
(
args
[
1
],
"off"
))
{
wrc_pps_force
(
pps_force_off
);
}
else
{
return
-
1
;
}
}
pp_printf
(
"PPS force %s
\n
"
,
pps_force_map
[
wrc_pps_force
(
pps_force_check
)]);
return
0
;
}
DEFINE_WRC_COMMAND
(
pps
)
=
{
.
name
=
"pps"
,
.
exec
=
cmd_pps
,
};
shell/shell.c
View file @
b0ede37f
...
...
@@ -41,6 +41,12 @@
#define KEY_BACKSPACE (127)
#define KEY_DELETE (126)
#ifdef CONFIG_CMD_PPS
#define HAS_CMD_PPS 1
#else
#define HAS_CMD_PPS 0
#endif
static
char
cmd_buf
[
SH_MAX_LINE_LEN
+
1
];
static
int
cmd_pos
=
0
,
cmd_len
=
0
;
static
int
state
=
SH_PROMPT
;
...
...
@@ -372,5 +378,6 @@ void shell_register_commands(void)
REGISTER_WRC_COMMAND
(
ip
);
if
(
HAS_VLANS
)
REGISTER_WRC_COMMAND
(
vlan
);
if
(
HAS_CMD_PPS
)
REGISTER_WRC_COMMAND
(
pps
);
}
shell/shell.mk
View file @
b0ede37f
...
...
@@ -25,5 +25,6 @@ obj-$(CONFIG_PPSI) += shell/cmd_verbose.o
obj-$(CONFIG_CMD_CONFIG) += shell/cmd_config.o
obj-$(CONFIG_CMD_SLEEP) += shell/cmd_sleep.o
obj-$(CONFIG_CMD_LL) += shell/cmd_ll.o
obj-$(CONFIG_CMD_PPS) += shell/cmd_pps.o
obj-$(CONFIG_FLASH_INIT) += shell/cmd_init.o
obj-$(CONFIG_VLAN) += shell/cmd_vlan.o
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment