Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
PolyORB-HI-C
Commits
f6b6f56b
Commit
f6b6f56b
authored
Jun 23, 2016
by
yoogx
Browse files
* At startup, task are not active
parent
f607f105
Pipeline
#377
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/po_hi_task.c
View file @
f6b6f56b
...
...
@@ -76,6 +76,8 @@ typedef struct
__po_hi_task_id
id
;
/* Identifier of the task in the system */
__po_hi_task_category
task_category
;
__po_hi_time_t
period
;
__po_hi_time_t
offset
;
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX)
__po_hi_time_t
timer
;
#if defined (_WIN32)
...
...
@@ -176,9 +178,10 @@ int __po_hi_compute_next_period (__po_hi_task_id task)
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX) || defined (_WIN32)
/* If we call this function for the first time, we need to configure
+
the initial timer to epoch */
the initial timer to epoch */
if
(
tasks
[
task
].
timer
.
sec
==
0
&&
tasks
[
task
].
timer
.
nsec
==
0
)
{
tasks
[
task
].
timer
=
get_epoch
();
__po_hi_add_times
(
&
(
tasks
[
task
].
timer
),
&
(
tasks
[
task
].
timer
),
&
tasks
[
task
].
offset
);
return
(
__PO_HI_SUCCESS
);
}
...
...
@@ -660,15 +663,10 @@ int __po_hi_create_periodic_task (const __po_hi_task_id id,
void
__po_hi_task_wait_offset
(
const
__po_hi_time_t
*
time
)
{
__po_hi_time_t
mytime
,
offset_time
;
if
(
time
->
sec
==
0
&&
time
->
nsec
==
0
)
return
;
// No need to wait, exit immediately
if
(
__po_hi_get_time
(
&
mytime
)
==
__PO_HI_SUCCESS
)
{
__po_hi_add_times
(
&
offset_time
,
&
mytime
,
time
);
__po_hi_delay_until
(
&
offset_time
);
}
else
__DEBUGMSG
(
"ERROR %s %d
\n
"
,
__FILE__
,
__LINE__
);
tasks
[
__po_hi_get_task_id
()].
offset
=
*
time
;
}
int
__po_hi_create_sporadic_task
(
const
__po_hi_task_id
id
,
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment