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
295adc21
Commit
295adc21
authored
Feb 11, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plc threads can now use SCHED_DEADLINE by setting a deadline > 0
parent
8232b1e3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
src/lib/rt/src/rt_plc_thread.c
src/lib/rt/src/rt_plc_thread.c
+3
-2
src/lib/rt/src/rt_thread.c
src/lib/rt/src/rt_thread.c
+5
-4
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
+8
-0
No files found.
src/lib/rt/src/rt_plc_thread.c
View file @
295adc21
...
...
@@ -38,6 +38,7 @@
Run a PLC thread. */
#include <errno.h>
#include <float.h>
#include <pwd.h>
#include <string.h>
#include <unistd.h>
...
...
@@ -313,8 +314,8 @@ void plc_thread(plc_sThread* tp)
tp
->
init
(
1
,
tp
);
if
(
tp
->
PlcThread
->
Prio
<
0
)
{
thread_SetDeadline
(
tp
->
PlcThread
);
if
(
tp
->
PlcThread
->
Deadline
>
FLT_EPSILON
)
{
sts
=
thread_SetDeadline
(
tp
->
PlcThread
);
}
else
{
sts
=
thread_SetPrio
(
&
tp
->
tid
,
tp
->
prio
);
}
...
...
src/lib/rt/src/rt_thread.c
View file @
295adc21
...
...
@@ -35,6 +35,7 @@
*/
#include <errno.h>
#include <float.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -248,11 +249,11 @@ pwr_tStatus thread_SetDeadline(pwr_sClass_PlcThread* o)
o
->
Description
,
attr
.
sched_period
/
(
1000
*
1000
),
attr
.
sched_runtime
/
(
1000
*
1000
));
}
/*if (o->Deadline
) {
if
(
o
->
Deadline
>
FLT_EPSILON
)
{
attr
.
sched_deadline
=
toNs
(
o
->
Deadline
);
} else {
*/
}
else
{
attr
.
sched_deadline
=
toNs
(
o
->
ScanTime
);
//
}
}
int
ret
=
sched_setattr
(
tid
,
&
attr
,
0
);
if
(
ret
!=
0
)
{
...
...
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
View file @
295adc21
...
...
@@ -74,6 +74,14 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Deadline for the plc thread.
!*/
Object Deadline $Attribute 37
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Plc thread options.
! Specification of the action when the execution time exceeds
! the scantime.
...
...
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