Skip to content
Snippets Groups Projects
Commit 59dd78ac authored by Federico's avatar Federico
Browse files

Disabled multiburst by default and fixed priority comparison, testsuite now...

Disabled multiburst by default and fixed priority comparison, testsuite now passes with control scheduler as long as multiburst is disabled. Still need to look into multiburst code.
parent 1667e49b
No related branches found
No related tags found
2 merge requests!40Update to Miosix 2.7,!17Draft: Improved miosix build system and fixed cmake scripts
......@@ -136,6 +136,7 @@ private:
inline bool operator<(ControlSchedulerPriority a, ControlSchedulerPriority b)
{
#ifdef SCHED_CONTROL_MULTIBURST
//rule 1) Idle thread should be always preempted by any thread!
//rule 2) Only REALTIME_PRIORITY_IMMEDIATE threads can preempt other threads
//right away, for other real-time priorities, the scheduler does not
......@@ -143,23 +144,38 @@ inline bool operator<(ControlSchedulerPriority a, ControlSchedulerPriority b)
return a.get()==-1 ||
(a.getRealtime()!=ControlRealtimePriority::REALTIME_PRIORITY_IMMEDIATE &&
b.getRealtime()==ControlRealtimePriority::REALTIME_PRIORITY_IMMEDIATE);
#else
return a.get()<b.get();
#endif
}
inline bool operator>(ControlSchedulerPriority a, ControlSchedulerPriority b)
{
#ifdef SCHED_CONTROL_MULTIBURST
return b.get()==-1 ||
(a.getRealtime()==ControlRealtimePriority::REALTIME_PRIORITY_IMMEDIATE &&
b.getRealtime()!=ControlRealtimePriority::REALTIME_PRIORITY_IMMEDIATE);
#else
return a.get()>b.get();
#endif
}
inline bool operator==(ControlSchedulerPriority a, ControlSchedulerPriority b)
{
#ifdef SCHED_CONTROL_MULTIBURST
return (a.getRealtime()==b.getRealtime()) && (a.get()==b.get());
#else
return a.get()==b.get();
#endif
}
inline bool operator!=(ControlSchedulerPriority a, ControlSchedulerPriority b)
{
#ifdef SCHED_CONTROL_MULTIBURST
return (a.getRealtime()!=b.getRealtime()) || (a.get()!=b.get());
#else
return a.get()!=b.get();
#endif
}
struct ThreadsListItem : public IntrusiveListItem
......
......@@ -47,7 +47,7 @@ namespace miosix {
///Enables support for Real-time priorities in the control scheduler, that
///are otherwise ignored.
#define SCHED_CONTROL_MULTIBURST
//#define SCHED_CONTROL_MULTIBURST
///Run the scheduler using fixed point math only. Faster but less precise.
///Note that the inner integral regulators are always fixed point, this affects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment