Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
c3a5c415
Commit
c3a5c415
authored
Mar 26, 2015
by
Jeroen Vreeken
Browse files
Make sure we use large enough datatypes for the time.
(Especially on 32bit systems like ARM)
parent
88663f99
Changes
3
Hide whitespace changes
Inline
Side-by-side
controller/trigger/trigger_busyloop.c
View file @
c3a5c415
...
...
@@ -49,7 +49,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static
controller_trigger_time
ts2timestamp
(
struct
timespec
*
ts
)
{
return
ts
->
tv_nsec
+
ts
->
tv_sec
*
1000000000
;
return
(
uint64_t
)
ts
->
tv_nsec
+
(
uint64_t
)
ts
->
tv_sec
*
1000000000
;
}
...
...
@@ -64,7 +64,7 @@ static controller_trigger_time timestamp(void)
static
int
wait_init_default
(
struct
controller_trigger
*
trigger
,
struct
timespec
*
ts_interval
)
{
interval
=
ts_interval
->
tv_sec
*
1000000000
+
ts_interval
->
tv_nsec
;
interval
=
(
uint64_t
)
ts_interval
->
tv_sec
*
1000000000
+
(
uint64_t
)
ts_interval
->
tv_nsec
;
#ifndef __FreeBSD__
sample_clock
=
CLOCK_REALTIME
;
...
...
controller/trigger/trigger_default.c
View file @
c3a5c415
...
...
@@ -54,7 +54,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static
controller_trigger_time
ts2timestamp
(
struct
timespec
*
ts
)
{
return
ts
->
tv_nsec
+
ts
->
tv_sec
*
1000000000
;
return
(
uint64_t
)
ts
->
tv_nsec
+
(
uint64_t
)
ts
->
tv_sec
*
1000000000
;
}
...
...
@@ -69,7 +69,7 @@ static controller_trigger_time timestamp(void)
static
int
wait_init_default
(
struct
controller_trigger
*
trigger
,
struct
timespec
*
ts_interval
)
{
interval
=
ts_interval
->
tv_sec
*
1000000000
+
ts_interval
->
tv_nsec
;
interval
=
(
uint64_t
)
ts_interval
->
tv_sec
*
1000000000
+
(
uint64_t
)
ts_interval
->
tv_nsec
;
#ifndef __FreeBSD__
sample_clock
=
CLOCK_REALTIME
;
...
...
controller/trigger/trigger_prestart.c
View file @
c3a5c415
...
...
@@ -54,7 +54,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static
controller_trigger_time
ts2timestamp
(
struct
timespec
*
ts
)
{
return
ts
->
tv_nsec
+
ts
->
tv_sec
*
1000000000
;
return
(
uint64_t
)
ts
->
tv_nsec
+
(
uint64_t
)
ts
->
tv_sec
*
1000000000
;
}
...
...
@@ -69,7 +69,7 @@ static controller_trigger_time timestamp(void)
static
int
wait_init_default
(
struct
controller_trigger
*
trigger
,
struct
timespec
*
ts_interval
)
{
interval
=
ts_interval
->
tv_sec
*
1000000000
+
ts_interval
->
tv_nsec
;
interval
=
(
uint64_t
)
ts_interval
->
tv_sec
*
1000000000
+
(
uint64_t
)
ts_interval
->
tv_nsec
;
#ifndef __FreeBSD__
sample_clock
=
CLOCK_REALTIME
;
...
...
Write
Preview
Supports
Markdown
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