Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
0ad56ec0
Commit
0ad56ec0
authored
8 years ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Applied a fix to the control scheduler as suggested by Sasan
parent
bf956ab4
Branches
Branches containing commit
No related tags found
2 merge requests
!40
Update to Miosix 2.7
,
!17
Draft: Improved miosix build system and fixed cmake scripts
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
miosix/kernel/scheduler/control/control_scheduler.cpp
+10
-12
10 additions, 12 deletions
miosix/kernel/scheduler/control/control_scheduler.cpp
miosix/kernel/scheduler/control/control_scheduler.h
+2
-0
2 additions, 0 deletions
miosix/kernel/scheduler/control/control_scheduler.h
with
12 additions
and
12 deletions
miosix/kernel/scheduler/control/control_scheduler.cpp
+
10
−
12
View file @
0ad56ec0
...
...
@@ -756,39 +756,37 @@ void ControlScheduler::IRQrecalculateAlfa()
if
(
sumPriority
==
0
)
return
;
#ifndef SCHED_CONTROL_FIXED_POINT
float
base
=
1.0
f
/
((
float
)
sumPriority
);
//for(Thread *it=threadList;it!=0;it=it->schedData.next)
for
(
auto
it
=
activeThreads
.
begin
()
;
it
!=
activeThreads
.
end
()
;
it
++
)
for
(
Thread
*
it
=
threadList
;
it
!=
0
;
it
=
it
->
schedData
.
next
)
{
#ifdef ENABLE_FEEDFORWARD
//Assign zero bursts to blocked threads
if
(
(
*
it
)
->
t
->
flags
.
isReady
())
if
(
i
t
->
flags
.
isReady
())
{
(
*
it
)
->
t
->
schedData
.
alfa
=
base
*
((
float
)(
(
*
it
)
->
t
->
schedData
.
priority
.
get
()
+
1
));
i
t
->
schedData
.
alfa
=
base
*
((
float
)(
i
t
->
schedData
.
priority
.
get
()
+
1
));
}
else
{
(
*
it
)
->
t
->
schedData
.
alfa
=
0
;
i
t
->
schedData
.
alfa
=
0
;
}
#else //ENABLE_FEEDFORWARD
//Assign bursts irrespective of thread blocking status
(
*
it
)
->
t
->
schedData
.
alfa
=
base
*
((
float
)(
(
*
it
)
->
t
->
schedData
.
priority
.
get
()
+
1
));
i
t
->
schedData
.
alfa
=
base
*
((
float
)(
i
t
->
schedData
.
priority
.
get
()
+
1
));
#endif //ENABLE_FEEDFORWARD
}
#else //FIXED_POINT_MATH
//Sum of all alfa is maximum value for an unsigned short
unsigned
int
base
=
4096
/
sumPriority
;
//for(Thread *it=threadList;it!=0;it=it->schedData.next)
for
(
auto
it
=
activeThreads
.
begin
()
;
it
!=
activeThreads
.
end
()
;
it
++
)
for
(
Thread
*
it
=
threadList
;
it
!=
0
;
it
=
it
->
schedData
.
next
)
{
#ifdef ENABLE_FEEDFORWARD
//Assign zero bursts to blocked threads
if
(
(
*
it
)
->
t
->
flags
.
isReady
())
if
(
i
t
->
flags
.
isReady
())
{
(
*
it
)
->
t
->
schedData
.
alfa
=
base
*
(
(
*
it
)
->
t
->
schedData
.
priority
.
get
()
+
1
);
i
t
->
schedData
.
alfa
=
base
*
(
i
t
->
schedData
.
priority
.
get
()
+
1
);
}
else
{
(
*
it
)
->
t
->
schedData
.
alfa
=
0
;
i
t
->
schedData
.
alfa
=
0
;
}
#else //ENABLE_FEEDFORWARD
//Assign bursts irrespective of thread blocking status
(
*
it
)
->
t
->
schedData
.
alfa
=
base
*
(
(
*
it
)
->
t
->
schedData
.
priority
.
get
()
+
1
);
i
t
->
schedData
.
alfa
=
base
*
(
i
t
->
schedData
.
priority
.
get
()
+
1
);
#endif //ENABLE_FEEDFORWARD
}
#endif //FIXED_POINT_MATH
...
...
This diff is collapsed.
Click to expand it.
miosix/kernel/scheduler/control/control_scheduler.h
+
2
−
0
View file @
0ad56ec0
...
...
@@ -27,7 +27,9 @@
#ifndef CONTROL_SCHEDULER_H
#define CONTROL_SCHEDULER_H
#define SCHED_CONTROL_MULTIBURST
#include
"config/miosix_settings.h"
#include
"control_scheduler_types.h"
#include
"parameters.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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