Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
f8b3cd33
Commit
f8b3cd33
authored
Apr 28, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New phase for initialization of i/o
parent
080fe1af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
src/exp/rt/src/rt_plc_process.c
src/exp/rt/src/rt_plc_process.c
+25
-1
No files found.
src/exp/rt/src/rt_plc_process.c
View file @
f8b3cd33
...
...
@@ -42,6 +42,7 @@ static plc_sProcess *init_process ();
static
pwr_tStatus
init_plc
(
plc_sProcess
*
);
static
void
init_threads
(
plc_sProcess
*
);
static
void
start_threads
(
plc_sProcess
*
);
static
void
run_threads
(
plc_sProcess
*
);
static
void
stop_threads
(
plc_sProcess
*
);
static
void
clean_all
(
plc_sProcess
*
);
static
void
link_io_base_areas
(
plc_sProcess
*
);
...
...
@@ -135,6 +136,7 @@ int main (
// proc_SetPriority(pp->PlcProcess->Prio);
set_values
(
pp
);
start_threads
(
pp
);
run_threads
(
pp
);
time_Uptime
(
&
sts
,
&
pp
->
PlcProcess
->
StartTime
,
NULL
);
qcom_SignalOr
(
&
sts
,
&
qcom_cQini
,
ini_mEvent_newPlcStartDone
);
...
...
@@ -324,13 +326,35 @@ start_threads (
#endif
for
(
i
=
0
,
tp
=
pp
->
thread
;
i
<
pp
->
thread_count
;
i
++
,
tp
++
)
{
/* Tell thread it is time for phase 3,
run
. */
/* Tell thread it is time for phase 3,
start
. */
que_Put
(
&
sts
,
&
tp
->
q_in
,
&
tp
->
event
,
(
void
*
)
3
);
phase
=
(
int
)
que_Get
(
&
sts
,
&
tp
->
q_out
,
NULL
,
NULL
);
pwr_Assert
(
phase
==
3
);
}
}
static
void
run_threads
(
plc_sProcess
*
pp
)
{
int
i
;
plc_sThread
*
tp
;
pwr_tStatus
sts
;
int
phase
;
#if defined OS_LYNX && USE_RT_TIMER
create_timer
(
pp
);
#endif
for
(
i
=
0
,
tp
=
pp
->
thread
;
i
<
pp
->
thread_count
;
i
++
,
tp
++
)
{
/* Tell thread it is time for phase 4, run. */
que_Put
(
&
sts
,
&
tp
->
q_in
,
&
tp
->
event
,
(
void
*
)
4
);
phase
=
(
int
)
que_Get
(
&
sts
,
&
tp
->
q_out
,
NULL
,
NULL
);
pwr_Assert
(
phase
==
4
);
}
}
/* Wait for ALL of the threads to finish. If a thread'
CycleTime <> 0, then we assume that there in fact is an active
thread at that index, and therefore we wait until the
...
...
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