Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
84
Issues
84
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
White Rabbit Switch - Software
Commits
22538c6b
Commit
22538c6b
authored
May 08, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hal: read t24p for each port from dot-config
parent
6df4d4b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
hal_port_fsm.c
userspace/wrsw_hal/hal_port_fsm.c
+21
-2
No files found.
userspace/wrsw_hal/hal_port_fsm.c
View file @
22538c6b
...
...
@@ -19,6 +19,7 @@
#include <libwr/switch_hw.h>
#include <libwr/wrs-msg.h>
#include <libwr/generic_fsm.h>
#include <libwr/config.h>
#include "driver_stuff.h"
#include "hal_exports.h"
...
...
@@ -448,10 +449,28 @@ static void reset_port(struct hal_port_state * ps)
/* Port initialization */
static
void
init_port
(
struct
hal_port_state
*
ps
)
{
char
*
retValue
;
int
t24p
;
char
key
[
128
];
reset_port
(
ps
);
ps
->
t2_phase_transition
=
DEFAULT_T2_PHASE_TRANS
;
ps
->
t4_phase_transition
=
DEFAULT_T4_PHASE_TRANS
;
ps
->
clock_period
=
REF_CLOCK_PERIOD_PS
;
/* Rading t24p from the dot-config file could be done once in hal_ports, but
* I leave it here since we will implement automatic measurement procedure
* in the future release */
sprintf
(
key
,
"PORT%02i_INST01_T24P_TRANS_POINT"
,
ps
->
hw_index
+
1
);
if
(
(
retValue
=
libwr_cfg_get
(
key
))
==
NULL
)
{
pr_error
(
"port %i (%s): no key
\"
%s
\"
specified.
\n
"
,
ps
->
hw_index
+
1
,
ps
->
name
,
key
);
t24p
=
DEFAULT_T2_PHASE_TRANS
;
}
else
if
(
sscanf
(
retValue
,
"%i"
,
&
t24p
)
!=
1
)
{
pr_error
(
"port %i (%s): Invalid key
\"
%s
\"
value (%d).
\n
"
,
ps
->
hw_index
+
1
,
ps
->
name
,
key
,
*
retValue
);
}
ps
->
t2_phase_transition
=
t24p
;
ps
->
t4_phase_transition
=
t24p
;
}
...
...
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