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
7
Merge Requests
7
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
a40f30db
Commit
a40f30db
authored
Mar 30, 2021
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add udev-find prog and ertm_usb_by_function to seek SillyCon Labs
parent
623f74da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
private.h
libertm/private.h
+1
-0
udev-find.c
libertm/udev-find.c
+21
-0
udev-serial.c
libertm/udev-serial.c
+15
-8
No files found.
libertm/private.h
View file @
a40f30db
...
...
@@ -77,3 +77,4 @@ static const int ertm_ntemperatures =
extern
int
ertm_get_board_config
(
struct
ertm_status
*
st
,
struct
ertm14_board_state
*
bs
);
extern
char
*
ertm_find_usb_port
(
void
);
extern
char
*
ertm_usb_by_function
(
char
*
func
);
libertm/udev-find.c
0 → 100644
View file @
a40f30db
#include <stdio.h>
#include <string.h>
#include "private.h"
int
main
(
int
argc
,
char
*
argv
[])
{
char
*
devnode
;
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"usage: %s {mmc15|mmc14|wrc|wrc-console}
\n
"
,
argv
[
0
]);
exit
(
1
);
}
devnode
=
ertm_usb_by_function
(
argv
[
1
]);
if
(
devnode
==
NULL
)
{
fprintf
(
stderr
,
"could not find function %s
\n
"
,
argv
[
1
]);
exit
(
1
);
}
printf
(
"%s
\n
"
,
devnode
);
return
0
;
}
libertm/udev-serial.c
View file @
a40f30db
...
...
@@ -70,16 +70,23 @@ char *ertm_find_usb_port(void)
return
sl_cp2108_port
[
2
].
devnode
;
}
static
int
__attribute__
((
__unused__
))
udev_main
(
void
)
static
char
*
functions
[]
=
{
"mmc15"
,
"mmc14"
,
"wrc"
,
"wrc-console"
,
};
char
*
ertm_usb_by_function
(
char
*
func
)
{
int
i
;
int
err
;
printf
(
"control port is %s
\n
"
,
ertm_find_usb_port
());
err
=
ertm_search_dongle
(
SILICON_LABS_ID
,
CP2108_UART_TO_USB
,
sl_cp2108_port
);
if
(
err
<
0
)
return
NULL
;
for
(
i
=
0
;
i
<
4
;
i
++
)
printf
(
"port %d: %s at %s
\n
"
,
sl_cp2108_port
[
i
].
port
,
sl_cp2108_port
[
i
].
devnode
,
sl_cp2108_port
[
i
].
symlink
);
return
0
;
if
(
strcmp
(
func
,
functions
[
i
])
==
0
)
return
sl_cp2108_port
[
i
].
devnode
;
return
NULL
;
}
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