Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr2rf-vme
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
wr2rf-vme
Commits
48d4a3c5
Commit
48d4a3c5
authored
Jun 12, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr2rf.c: fix ext-ref command
parent
115b1544
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
wr2rf.c
software/libwr2rf/wr2rf.c
+10
-14
No files found.
software/libwr2rf/wr2rf.c
View file @
48d4a3c5
...
@@ -1905,32 +1905,28 @@ ext_ref (struct libwr2rf_dev *dev, int argc, char **argv)
...
@@ -1905,32 +1905,28 @@ ext_ref (struct libwr2rf_dev *dev, int argc, char **argv)
{
{
unsigned
addr
=
WR2RF_VME_REGS_INIT
+
WR2RF_INIT_REGS_PIN_CTRL
;
unsigned
addr
=
WR2RF_VME_REGS_INIT
+
WR2RF_INIT_REGS_PIN_CTRL
;
unsigned
v
=
0
;
unsigned
v
=
0
;
unsigned
i
;
if
(
argc
==
3
)
{
v
=
libwr2rf_read16
(
dev
,
addr
);
if
(
strcmp
(
argv
[
1
],
"10m_in"
)
==
0
)
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"10m_in"
)
==
0
)
v
=
v
&
~
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
;
v
=
v
&
~
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
;
else
if
(
strcmp
(
argv
[
1
],
"10m_out"
)
==
0
)
else
if
(
strcmp
(
argv
[
i
],
"10m_out"
)
==
0
)
v
=
v
|
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
;
v
=
v
|
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
;
else
{
else
if
(
strcmp
(
argv
[
i
],
"pps_in"
)
==
0
)
goto
usage
;
}
if
(
strcmp
(
argv
[
1
],
"pps_in"
)
==
0
)
v
=
v
&
~
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
;
v
=
v
&
~
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
;
else
if
(
strcmp
(
argv
[
1
],
"pps_out"
)
==
0
)
else
if
(
strcmp
(
argv
[
i
],
"pps_out"
)
==
0
)
v
=
v
|
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
;
v
=
v
|
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
;
else
{
else
{
goto
usage
;
printf
(
"usage: ext-ref {10m_in|10m_out|pps_in|pps_out}
\n
"
);
return
;
}
}
libwr2rf_write16
(
dev
,
addr
,
v
);
libwr2rf_write16
(
dev
,
addr
,
v
);
}
}
v
=
libwr2rf_read16
(
dev
,
addr
);
printf
(
"ext-10m dir: %01x (0:in, 1:out)
\n
"
,
!!
(
v
&
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
)
);
printf
(
"ext-10m dir: %01x (0:in, 1:out)
\n
"
,
!!
(
v
&
WR2RF_INIT_REGS_PIN_CTRL_EXT_10M_DIR
)
);
printf
(
"ext-pps dir: %01x (0:in, 1:out)
\n
"
,
!!
(
v
&
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
)
);
printf
(
"ext-pps dir: %01x (0:in, 1:out)
\n
"
,
!!
(
v
&
WR2RF_INIT_REGS_PIN_CTRL_EXT_PPS_DIR
)
);
return
;
usage:
printf
(
"usage: ext-ref [10m_in|10m_out] [pps_in|pps_out]
\n
"
);
}
}
static
void
static
void
...
...
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