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
31
Issues
31
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
9a4fabc1
Commit
9a4fabc1
authored
Dec 17, 2019
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wr-starting-kit' into proposed_master
parents
97c2f4b9
3c9b25b8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
180 additions
and
60 deletions
+180
-60
.gitmodules
.gitmodules
+1
-1
Kconfig
Kconfig
+11
-2
wrnic_defconfig
configs/wrnic_defconfig
+3
-6
wrpc.tex
doc/wrpc.tex
+12
-6
monitor_ppsi.c
monitor/monitor_ppsi.c
+5
-0
cmd_stat.c
shell/cmd_stat.c
+3
-0
pfilter-builder.c
tools/pfilter-builder.c
+15
-4
wrpc-vuart.c
tools/wrpc-vuart.c
+130
-41
No files found.
.gitmodules
View file @
9a4fabc1
[submodule "ppsi"]
[submodule "ppsi"]
path = ppsi
path = ppsi
url =
git://ohwr.org/white-rabbi
t/ppsi.git
url =
https://ohwr.org/projec
t/ppsi.git
Kconfig
View file @
9a4fabc1
...
@@ -127,8 +127,17 @@ config P2P
...
@@ -127,8 +127,17 @@ config P2P
If you deny this option, P2P code is not built, to save some
If you deny this option, P2P code is not built, to save some
binary size.
binary size.
config
IP
config
WR_NIC_CPU
depends on WR_NODE
depends on WR_NODE
boolean "Allows compatibility with external NIC driver on CPU"
default n
help
ARP & ICMP traffic are bypassed to the external fabric (NIC) so
that the CPU handles these packets and not the LM32. (This option
is mainly used by the wr-starting-kit on SPEC cards)
config IP
depends on WR_NODE && !WR_NIC_CPU
boolean "Compile minimal IP support in wrpc-sw"
boolean "Compile minimal IP support in wrpc-sw"
help
help
This allows to run LM32 code that is aware of IP. The feature is
This allows to run LM32 code that is aware of IP. The feature is
...
@@ -313,7 +322,7 @@ config ABSCAL
...
@@ -313,7 +322,7 @@ config ABSCAL
described and documented by Peter Jansweijer.
described and documented by Peter Jansweijer.
config LLDP
config LLDP
depends on WR_NODE
depends on WR_NODE
&& IP
boolean "Include LLDP protocol transmit-only"
boolean "Include LLDP protocol transmit-only"
default n
default n
help
help
...
...
configs/wrnic_defconfig
View file @
9a4fabc1
...
@@ -24,21 +24,18 @@ CONFIG_PPSI=y
...
@@ -24,21 +24,18 @@ CONFIG_PPSI=y
CONFIG_W1=y
CONFIG_W1=y
CONFIG_LATENCY_ETHTYPE=291
CONFIG_LATENCY_ETHTYPE=291
# CONFIG_P2P is not set
# CONFIG_P2P is not set
CONFIG_
IP
=y
CONFIG_
WR_NIC_CPU
=y
# CONFIG_CMD_CONFIG is not set
# CONFIG_CMD_CONFIG is not set
# CONFIG_SYSLOG is not set
CONFIG_SNMP=y
CONFIG_SNMP_SET=y
CONFIG_BUILD_INIT=y
CONFIG_BUILD_INIT=y
CONFIG_INIT_COMMAND="vlan off;ptp stop;sfp match;mode slave;ptp start"
CONFIG_INIT_COMMAND="vlan off;ptp stop;sfp match;mode slave;ptp start"
CONFIG_HAS_BUILD_INIT=1
CONFIG_HAS_BUILD_INIT=1
CONFIG_HAS_FLASH_INIT=1
CONFIG_HAS_FLASH_INIT=1
CONFIG_FLASH_INIT=y
CONFIG_FLASH_INIT=y
# CONFIG_AUX_DIAG is not set
CONFIG_AUX_DIAG=y
CONFIG_SDB_STORAGE=y
CONFIG_SDB_STORAGE=y
CONFIG_GENSDBFS=y
CONFIG_GENSDBFS=y
# CONFIG_LEGACY_EEPROM is not set
# CONFIG_LEGACY_EEPROM is not set
# CONFIG_WR_DIAG is not set
CONFIG_WR_DIAG=y
# CONFIG_WR_NODE_SIM is not set
# CONFIG_WR_NODE_SIM is not set
CONFIG_ABSCAL=y
CONFIG_ABSCAL=y
...
...
doc/wrpc.tex
View file @
9a4fabc1
...
@@ -433,13 +433,18 @@ you would have to install it manually. E.g. in Ubuntu, please install
...
@@ -433,13 +433,18 @@ you would have to install it manually. E.g. in Ubuntu, please install
First, you need to download and unpack the LM32 toolchain from the location
First, you need to download and unpack the LM32 toolchain from the location
mentioned in section
\ref
{
Repositories and Releases
}
. The following example
mentioned in section
\ref
{
Repositories and Releases
}
. The following example
uses 32bit version of a toolchain. If you encounter problems running it, please
uses 32bit version of a toolchain.
use 64bit version.
\begin{lstlisting}
\begin{lstlisting}
$
wget http
:
//
www.ohwr.org
/
attachments
/
download
/
1133
/
lm
32
.tar.xz
$
wget http
s:
//
www.ohwr.org
/
project
/
wrpc
-
sw
/
uploads
/
a
2
e
8
eeba
448
fbc
8
d
580
e
68004
e
6
f
6
c
7
f
/
lm
32
.tar.xz
$
tar xJf lm32.tar.xz -C <your
_
location>
$
tar xJf lm32.tar.xz -C <your
_
location>
\end{lstlisting}
\end{lstlisting}
If you encounter problems running it, please use the 64bit version.
\begin{lstlisting}
$
wget https:
//
www.ohwr.org
/
project
/
wrpc
-
sw
/
uploads
/
2776
ce
0
ba
43503
d
1486
ae
205
b
48
fb
450
/
lm
32
_
host
_
64
bit.tar.xz
$
tar xJf lm32
_
host
_
64bit.tar.xz -C <your
_
location>
\end{lstlisting}
Then you need to set a
\texttt
{
CROSS
\_
COMPILE
}
environment variable in order
Then you need to set a
\texttt
{
CROSS
\_
COMPILE
}
environment variable in order
to compile the software for the LM32 processor:
to compile the software for the LM32 processor:
\begin{lstlisting}
\begin{lstlisting}
...
@@ -531,7 +536,8 @@ $ make
...
@@ -531,7 +536,8 @@ $ make
You have to download also the "golden" firmware for SPEC card. It is used by
You have to download also the "golden" firmware for SPEC card. It is used by
the drivers to recognize the hardware:
the drivers to recognize the hardware:
\begin{lstlisting}
\begin{lstlisting}
$
wget http:
//
www.ohwr.org
/
attachments
/
download
/
4057
/
spec
-
init.bin
-
2015
-
09
-
18
$
wget https:
//
www.ohwr.org
/
project
/
spec
-
sw
/
uploads
/
636
e
7
eaa
2
e
1
c
3
a
884
e
2
f
9
f
694
fdfd
1
b
9
/
spec
-
init.bin
-
2015
-
09
-
18
$
sudo mv spec-init.bin-2015-09-18 /lib/firmware/fmc/spec-init.bin
$
sudo mv spec-init.bin-2015-09-18 /lib/firmware/fmc/spec-init.bin
\end{lstlisting}
\end{lstlisting}
...
@@ -2044,7 +2050,7 @@ package.
...
@@ -2044,7 +2050,7 @@ package.
First, please download the SDBFS image from
\textit
{
ohwr.org
}
:
First, please download the SDBFS image from
\textit
{
ohwr.org
}
:
\begin{lstlisting}
\begin{lstlisting}
$
wget http
:
//
www.ohwr.org
/
attachments
/
download
/
4060
/
sdbfs
-
flash.bin
$
wget http
s:
//
www.ohwr.org
/
project
/
wr
-
cores
/
uploads
/
6
f
33
b
5
a
8660
bd
0
f
2
ff
7
a
07526
b
4484
d
6
/
sdbfs
-
flash.bin
\end
{
lstlisting
}
\end
{
lstlisting
}
It contains all the files required by the core. They are empty, but have to
It contains all the files required by the core. They are empty, but have to
exist in the SDBFS structure to be filled later from the WR PTP Core shell or
exist in the SDBFS structure to be filled later from the WR PTP Core shell or
...
@@ -2083,7 +2089,7 @@ This \textit{mcs} file already includes both SDBFS image and FPGA bitstream.
...
@@ -2083,7 +2089,7 @@ This \textit{mcs} file already includes both SDBFS image and FPGA bitstream.
In the case when you want to run a custom gateware or you have a custom hardware, you can
In the case when you want to run a custom gateware or you have a custom hardware, you can
download a standalone SDBFS image:
download a standalone SDBFS image:
\begin
{
lstlisting
}
\begin
{
lstlisting
}
$
wget http
://www.ohwr.org/attachments/download/4558
/sdbfs-standalone-160812.bin
$
wget http
s://www.ohwr.org/project/wr-cores/uploads/9dad995e74a3d49b472b8654833be01a
/sdbfs-standalone-160812.bin
\end{lstlisting}
\end{lstlisting}
and generate a custom
\textit
{
*.mcs
}
file with your own FPGA bitstream. You should
and generate a custom
\textit
{
*.mcs
}
file with your own FPGA bitstream. You should
use the following layout:
use the following layout:
...
...
monitor/monitor_ppsi.c
View file @
9a4fabc1
...
@@ -330,6 +330,11 @@ static int wrc_log_stats(void)
...
@@ -330,6 +330,11 @@ static int wrc_log_stats(void)
ptp_mode
!=
WRC_MODE_SLAVE
)
ptp_mode
!=
WRC_MODE_SLAVE
)
return
0
;
return
0
;
last_jiffies
=
timer_get_tics
();
last_jiffies
=
timer_get_tics
();
/* Print only one time */
if
(
wrc_stat_running
==
-
1
)
wrc_stat_running
=
0
;
wrc_stats_last
=
s
->
update_count
;
wrc_stats_last
=
s
->
update_count
;
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
...
...
shell/cmd_stat.c
View file @
9a4fabc1
...
@@ -35,6 +35,9 @@ static int cmd_stat(const char *args[])
...
@@ -35,6 +35,9 @@ static int cmd_stat(const char *args[])
}
else
if
(
!
strcasecmp
(
args
[
0
],
"off"
))
{
}
else
if
(
!
strcasecmp
(
args
[
0
],
"off"
))
{
wrc_stat_running
=
0
;
wrc_stat_running
=
0
;
pp_printf
(
"statistics now off
\n
"
);
pp_printf
(
"statistics now off
\n
"
);
}
else
if
(
!
strcasecmp
(
args
[
0
],
"1"
))
{
wrc_stat_running
=
-
1
;
/* Special meaning... (only one) */
wrc_stats_last
--
;
/* force a line to be printed */
}
else
}
else
return
-
EINVAL
;
return
-
EINVAL
;
return
0
;
return
0
;
...
...
tools/pfilter-builder.c
View file @
9a4fabc1
...
@@ -18,12 +18,15 @@
...
@@ -18,12 +18,15 @@
the internal fabric. The frame, in the fabric, is prefixed with
the internal fabric. The frame, in the fabric, is prefixed with
a status word that includes the class bits.
a status word that includes the class bits.
The
CPU is expected to receive PTP, ICMP, ARP and DHCP replies (so
The
LM32 CPU is expected to receive PTP and if probably ICMP, ARP
local "bootpc" port).
and DHCP replies (so
local "bootpc" port).
The fabric should receive Etherbone (i.e. UDP port 0xebd0), the
The fabric should receive Etherbone (i.e. UDP port 0xebd0), the
"streamer" protocol used by some CERN installation (ethtype 0xdbff)
"streamer" protocol used by some CERN installation (ethtype 0xdbff).
and everything else if the "NIC pfilter" feature by 7Solutions is used.
If an external NIC is used we should redirect everything (including
ARP,ICMP,DHCP) there excepting the PTP packets that should be handle
by LM32.
The logic cells connected to the fabric do their own check on the
The logic cells connected to the fabric do their own check on the
frames, so it's not a problem if extra frames reach the fabric. Thus,
frames, so it's not a problem if extra frames reach the fabric. Thus,
...
@@ -413,9 +416,17 @@ void pfilter_init_novlan(char *fname)
...
@@ -413,9 +416,17 @@ void pfilter_init_novlan(char *fname)
pfilter_cmp
(
11
,
0x0011
,
0x00ff
,
MOV
,
FRAME_UDP
);
pfilter_cmp
(
11
,
0x0011
,
0x00ff
,
MOV
,
FRAME_UDP
);
pfilter_logic2
(
FRAME_UDP
,
FRAME_UDP
,
AND
,
FRAME_IP_OK
);
pfilter_logic2
(
FRAME_UDP
,
FRAME_UDP
,
AND
,
FRAME_IP_OK
);
#ifdef CONFIG_WR_NIC_CPU
/* For CPU: icmp unicast or ptp (or latency) */
/* Now, ARP & ICMP traffic are bypassed to the external fabric (NIC) */
pfilter_logic2
(
FRAME_FOR_CPU
,
FRAME_TYPE_PTP2
,
MOV
,
R_ZERO
);
#else
/* For CPU: arp or icmp unicast or ptp (or latency) */
/* For CPU: arp or icmp unicast or ptp (or latency) */
pfilter_logic2
(
FRAME_FOR_CPU
,
FRAME_TYPE_ARP
,
OR
,
FRAME_TYPE_PTP2
);
pfilter_logic2
(
FRAME_FOR_CPU
,
FRAME_TYPE_ARP
,
OR
,
FRAME_TYPE_PTP2
);
pfilter_logic3
(
FRAME_FOR_CPU
,
FRAME_IP_OK
,
AND
,
FRAME_ICMP
,
OR
,
FRAME_FOR_CPU
);
pfilter_logic3
(
FRAME_FOR_CPU
,
FRAME_IP_OK
,
AND
,
FRAME_ICMP
,
OR
,
FRAME_FOR_CPU
);
#endif
/* Now look in UDP ports: at offset 18 (14 + 20 + 8 = 36) */
/* Now look in UDP ports: at offset 18 (14 + 20 + 8 = 36) */
pfilter_cmp
(
18
,
0x0000
,
0xff00
,
MOV
,
PORT_UDP_HOST
);
/* ports 0-255 */
pfilter_cmp
(
18
,
0x0000
,
0xff00
,
MOV
,
PORT_UDP_HOST
);
/* ports 0-255 */
...
...
tools/wrpc-vuart.c
View file @
9a4fabc1
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
#include <hw/wb_uart.h>
#include <hw/wb_uart.h>
#include <libdevmap.h>
#include <libdevmap.h>
#define VUART_EOL 13
#define VUART_CMD_USLEEP 1000000
#define VUART_CMD_PROMPT "wrc#"
static
void
wrpc_vuart_help
(
char
*
prog
)
static
void
wrpc_vuart_help
(
char
*
prog
)
{
{
const
char
*
mapping_help_str
;
const
char
*
mapping_help_str
;
...
@@ -80,6 +84,19 @@ static size_t wr_vuart_read(struct mapping_desc *vuart, char *buf, size_t size)
...
@@ -80,6 +84,19 @@ static size_t wr_vuart_read(struct mapping_desc *vuart, char *buf, size_t size)
return
n_rx
;
return
n_rx
;
}
}
/**
* It flush vuart buffer.
*
* @param[in] vuart token from dev_map()
*
*/
static
void
wr_vuart_flush
(
struct
mapping_desc
*
vuart
)
{
char
rx
;
while
(
wr_vuart_read
(
vuart
,
&
rx
,
1
)
==
1
)
{}
}
/**
/**
* It writes a number of bytes from a given buffer
* It writes a number of bytes from a given buffer
* @param[in] vuart token from dev_map()
* @param[in] vuart token from dev_map()
...
@@ -99,16 +116,22 @@ static size_t wr_vuart_write(struct mapping_desc *vuart, char *buf, size_t size)
...
@@ -99,16 +116,22 @@ static size_t wr_vuart_write(struct mapping_desc *vuart, char *buf, size_t size)
return
size
;
return
size
;
}
}
static
void
wrpc_vuart_term_main
(
struct
mapping_desc
*
vuart
,
int
keep_term
)
static
void
wrpc_vuart_term_main
(
struct
mapping_desc
*
vuart
,
int
keep_term
,
int
command_mode
,
char
*
command
)
{
{
struct
termios
oldkey
,
newkey
;
struct
termios
oldkey
,
newkey
;
//above is place for old and new port settings for keyboard teletype
//above is place for old and new port settings for keyboard teletype
int
need_exit
=
0
;
int
need_exit
=
0
;
int
cmd_sent
=
0
;
int
cmd_len
=
0
;
char
*
prompt
=
VUART_CMD_PROMPT
;
int
i_prompt
=
0
;
int
i
;
fd_set
fds
;
fd_set
fds
;
int
ret
;
int
ret
;
char
rx
,
tx
;
char
rx
,
tx
;
fprintf
(
stderr
,
"[press C-a to exit]
\n
"
);
if
(
!
command_mode
)
fprintf
(
stderr
,
"[press C-a to exit]
\n
"
);
if
(
!
keep_term
)
{
if
(
!
keep_term
)
{
tcgetattr
(
STDIN_FILENO
,
&
oldkey
);
tcgetattr
(
STDIN_FILENO
,
&
oldkey
);
...
@@ -122,49 +145,102 @@ static void wrpc_vuart_term_main(struct mapping_desc *vuart, int keep_term)
...
@@ -122,49 +145,102 @@ static void wrpc_vuart_term_main(struct mapping_desc *vuart, int keep_term)
tcsetattr
(
STDIN_FILENO
,
TCSANOW
,
&
newkey
);
tcsetattr
(
STDIN_FILENO
,
TCSANOW
,
&
newkey
);
}
}
while
(
!
need_exit
)
{
while
(
!
need_exit
)
{
struct
timeval
tv
=
{
0
,
10000
};
if
(
!
command_mode
)
{
struct
timeval
tv
=
{
0
,
10000
};
FD_ZERO
(
&
fds
);
FD_SET
(
STDIN_FILENO
,
&
fds
);
FD_ZERO
(
&
fds
);
FD_SET
(
STDIN_FILENO
,
&
fds
);
/*
* Check if the STDIN has characters to read
/*
* (what the user writes)
* Check if the STDIN has characters to read
*/
* (what the user writes)
ret
=
select
(
STDIN_FILENO
+
1
,
&
fds
,
NULL
,
NULL
,
&
tv
);
*/
switch
(
ret
)
{
ret
=
select
(
STDIN_FILENO
+
1
,
&
fds
,
NULL
,
NULL
,
&
tv
);
case
-
1
:
switch
(
ret
)
{
perror
(
"select"
);
case
-
1
:
break
;
perror
(
"select"
);
case
0
:
/* timeout */
break
;
break
;
case
0
:
/* timeout */
default:
break
;
if
(
!
FD_ISSET
(
STDIN_FILENO
,
&
fds
))
default:
if
(
!
FD_ISSET
(
STDIN_FILENO
,
&
fds
))
break
;
/* The user wrote something */
do
{
ret
=
read
(
STDIN_FILENO
,
&
tx
,
1
);
}
while
(
ret
<
0
&&
errno
==
EINTR
);
if
(
ret
!=
1
)
{
fprintf
(
stderr
,
"nothing to read. Port disconnected?
\n
"
);
need_exit
=
1
;
/* kill */
}
/* If the user character is C-a, then kill */
if
(
tx
==
'\x01'
)
need_exit
=
1
;
ret
=
wr_vuart_write
(
vuart
,
&
tx
,
1
);
if
(
ret
!=
1
)
{
fprintf
(
stderr
,
"Unable to write (errno: %d)
\n
"
,
errno
);
need_exit
=
1
;
}
break
;
break
;
/* The user wrote something */
do
{
ret
=
read
(
STDIN_FILENO
,
&
tx
,
1
);
}
while
(
ret
<
0
&&
errno
==
EINTR
);
if
(
ret
!=
1
)
{
fprintf
(
stderr
,
"nothing to read. Port disconnected?
\n
"
);
need_exit
=
1
;
/* kill */
}
}
/* If the user character is C-a, then kill */
}
else
{
if
(
tx
==
'\x01'
)
if
(
!
cmd_sent
)
{
need_exit
=
1
;
/* Flush Vuart before sending command */
wr_vuart_flush
(
vuart
);
ret
=
wr_vuart_write
(
vuart
,
&
tx
,
1
);
/* Send command */
if
(
ret
!=
1
)
{
cmd_len
=
strlen
(
command
);
fprintf
(
stderr
,
"Unable to write (errno: %d)
\n
"
,
errno
);
ret
=
wr_vuart_write
(
vuart
,
command
,
cmd_len
-
1
);
need_exit
=
1
;
if
(
ret
!=
cmd_len
-
1
)
{
fprintf
(
stderr
,
"Unable to write the command (errno: %d)
\n
"
,
errno
);
need_exit
=
1
;
}
/* Flush command echo */
wr_vuart_flush
(
vuart
);
/* Send end character */
ret
=
wr_vuart_write
(
vuart
,
&
command
[
cmd_len
-
1
],
1
);
if
(
ret
!=
1
)
{
fprintf
(
stderr
,
"Unable to write the end character of command (errno: %d)
\n
"
,
errno
);
need_exit
=
1
;
}
/* Wait for a while before reading command results */
usleep
(
VUART_CMD_USLEEP
);
/* Discard characters until end of line control one */
while
(
wr_vuart_read
(
vuart
,
&
rx
,
1
))
{
if
(
rx
==
VUART_EOL
)
break
;
}
cmd_sent
=
1
;
}
}
break
;
}
}
/* Print all the incoming charactes */
/* Print all the incoming charactes */
while
((
wr_vuart_read
(
vuart
,
&
rx
,
1
))
==
1
)
while
((
wr_vuart_read
(
vuart
,
&
rx
,
1
))
==
1
)
{
fprintf
(
stderr
,
"%c"
,
rx
);
if
(
command_mode
==
1
)
{
/* Prompt detection, skip characters */
if
(
rx
==
prompt
[
i_prompt
])
{
i_prompt
++
;
/* Prompt detected! */
if
(
i_prompt
==
strlen
(
prompt
))
{
need_exit
=
1
;
break
;
}
}
else
{
/* Check if some previous characters have been skipped by
prompt detector code and print them */
for
(
i
=
0
;
i
<
i_prompt
;
i
++
)
fprintf
(
stderr
,
"%c"
,
prompt
[
i
]);
/* Reset prompt detector */
i_prompt
=
0
;
/* Print current character */
fprintf
(
stderr
,
"%c"
,
rx
);
}
}
else
{
fprintf
(
stderr
,
"%c"
,
rx
);
}
}
}
}
if
(
!
keep_term
)
if
(
!
keep_term
)
...
@@ -176,6 +252,9 @@ int main(int argc, char *argv[])
...
@@ -176,6 +252,9 @@ int main(int argc, char *argv[])
{
{
char
c
;
char
c
;
int
keep_term
=
0
;
int
keep_term
=
0
;
int
command_mode
=
0
;
char
cmd
[
50
];
int
cmd_len
=
0
;
struct
mapping_args
*
map_args
;
struct
mapping_args
*
map_args
;
struct
mapping_desc
*
vuart
=
NULL
;
struct
mapping_desc
*
vuart
=
NULL
;
...
@@ -186,8 +265,18 @@ int main(int argc, char *argv[])
...
@@ -186,8 +265,18 @@ int main(int argc, char *argv[])
}
}
/* Parse specific args */
/* Parse specific args */
while
((
c
=
getopt
(
argc
,
argv
,
"k"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"
c:
k"
))
!=
-
1
)
{
switch
(
c
)
{
switch
(
c
)
{
case
'c'
:
/* Enable command mode */
command_mode
=
1
;
/* Get the command from args */
strcpy
(
cmd
,
optarg
);
cmd_len
=
strlen
(
cmd
);
/* Put end of buffer for terminal */
cmd
[
cmd_len
]
=
VUART_EOL
;
cmd
[
cmd_len
+
1
]
=
0
;
break
;
case
'k'
:
case
'k'
:
keep_term
=
1
;
keep_term
=
1
;
break
;
break
;
...
@@ -206,7 +295,7 @@ int main(int argc, char *argv[])
...
@@ -206,7 +295,7 @@ int main(int argc, char *argv[])
goto
out
;
goto
out
;
}
}
wrpc_vuart_term_main
(
vuart
,
keep_term
);
wrpc_vuart_term_main
(
vuart
,
keep_term
,
command_mode
,
cmd
);
dev_unmap
(
vuart
);
dev_unmap
(
vuart
);
return
0
;
return
0
;
...
...
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