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
86
Issues
86
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
291a32c7
Commit
291a32c7
authored
Feb 19, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/wrsw_hal: use get_monotonic_* instead of clock_gettime
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
a978dea1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
hal_main.c
userspace/wrsw_hal/hal_main.c
+5
-5
No files found.
userspace/wrsw_hal/hal_main.c
View file @
291a32c7
...
...
@@ -17,6 +17,7 @@
#include <libwr/sfp_lib.h>
#include <libwr/config.h>
#include <libwr/hal_shmem.h>
#include <libwr/util.h>
#include "wrsw_hal.h"
#include <rt_ipc.h>
...
...
@@ -214,7 +215,7 @@ static void hal_parse_cmdline(int argc, char *argv[])
int
main
(
int
argc
,
char
*
argv
[])
{
struct
timespec
t1
,
t2
;
uint64_t
t1
,
t2
;
wrs_msg_init
(
argc
,
argv
);
...
...
@@ -246,15 +247,14 @@ int main(int argc, char *argv[])
* includes some jitter.
*/
clock_gettime
(
CLOCK_MONOTONIC
,
&
t1
);
t1
=
get_monotonic_tics
(
);
for
(;;)
{
int
delay_ms
;
hal_update_wripc
(
25
/* max ms delay */
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
t2
);
delay_ms
=
(
t2
.
tv_sec
-
t1
.
tv_sec
)
*
1000
;
delay_ms
+=
(
t2
.
tv_nsec
-
t1
.
tv_nsec
)
/
1000
/
1000
;
t2
=
get_monotonic_tics
();
delay_ms
=
(
t2
-
t1
)
*
1000
;
if
(
delay_ms
<
PORT_FAN_MS_PERIOD
)
continue
;
...
...
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