Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PPSi
Manage
Activity
Members
Labels
Plan
Issues
55
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
PPSi
Commits
9ef24075
Commit
9ef24075
authored
5 years ago
by
Jean-Claude BAU
Browse files
Options
Downloads
Patches
Plain Diff
Add a rounding value for interval to picos convertion
parent
4fe4f791
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/ppsi/ieee1588_types.h
+1
-1
1 addition, 1 deletion
include/ppsi/ieee1588_types.h
include/ppsi/pp-time.h
+1
-1
1 addition, 1 deletion
include/ppsi/pp-time.h
lib/time-arith.c
+1
-1
1 addition, 1 deletion
lib/time-arith.c
with
3 additions
and
3 deletions
include/ppsi/ieee1588_types.h
+
1
−
1
View file @
9ef24075
...
...
@@ -54,7 +54,7 @@ typedef struct _UInteger64 { /*/* TODO : Should be replaced by UInteger64 */
#define TIME_INTERVAL_FRACBITS 16
#define TIME_INTERVAL_FRACMASK 0xFFFF
#define TIME_INTERVAL_FRACBITS_AS_FLOAT 16.0
#define TIME_INTERVAL_ROUNDING_VALUE (1<<(TIME_INTERVAL_FRACBITS-1))
#define TIME_INTERVAL_ROUNDING_VALUE (
(uint64_t)
1<<(TIME_INTERVAL_FRACBITS-1))
/* Min/max value expressed in picos (int64_t) which can be stored in a TimeInterval type */
#define TIME_INTERVAL_MIN_PICOS_VALUE_AS_INT64 ((int64_t) 0xFE0C000000000000)
...
...
This diff is collapsed.
Click to expand it.
include/ppsi/pp-time.h
+
1
−
1
View file @
9ef24075
...
...
@@ -4,7 +4,7 @@
#define TIME_FRACBITS 16
#define TIME_FRACMASK 0xFFFF
#define TIME_FRACBITS_AS_FLOAT 16.0
#define TIME_ROUNDING_VALUE (1<<(TIME_FRACBITS-1))
#define TIME_ROUNDING_VALUE (
(uint64_t)
1<<(TIME_FRACBITS-1))
/* Everything internally uses this time format, *signed* */
struct
pp_time
{
...
...
This diff is collapsed.
Click to expand it.
lib/time-arith.c
+
1
−
1
View file @
9ef24075
...
...
@@ -178,7 +178,7 @@ TimeInterval picos_to_interval(int64_t picos)
int64_t
interval_to_picos
(
TimeInterval
interval
)
{
return
(
interval
*
1000
)
>>
TIME_INTERVAL_FRACBITS
;
return
((
(
interval
*
(
int64_t
)
1000
)
+
TIME_INTERVAL_ROUNDING_VALUE
)
>>
TIME_INTERVAL_FRACBITS
)
;
}
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment