Struct embedded_flight::scheduler::Scheduler
source · [−]pub struct Scheduler<'a, C, T, E = Error> {
pub tasks: &'a mut [Task<T, E>],
pub clock: C,
pub tick: u16,
pub max_task_slowdown: u8,
pub loop_rate_hz: i16,
pub task_not_achieved: u32,
pub task_all_achieved: u32,
pub loop_timer_start_us: u32,
pub last_loop_time_s: f32,
pub extra_loop_us: u32,
/* private fields */
}Expand description
Task scheduler for flight controllers
Fields
tasks: &'a mut [Task<T, E>]The tasks to run in order of highest to lowest priority.
clock: CThe clock used for timing.
tick: u16The current tick, incremented each run.
max_task_slowdown: u8The maximum amount of ticks a task can miss before slowing down the scheduler.
loop_rate_hz: i16The desired loop rate to run (in hz).
task_not_achieved: u32The amount of ticks with tasks that exceed the max_task_slowdown.
task_all_achieved: u32The amount of ticks with tasks that remain in the max_task_slowdown.
loop_timer_start_us: u32The start time of the run loop (in microseconds).
last_loop_time_s: f32The start time of the run loop (in seconds).
extra_loop_us: u32Extra time to spend in the loop to catch up on tasks not achieved (in microseconds).
Implementations
sourceimpl<'a, C, T, E> Scheduler<'a, C, T, E> where
C: Clock,
C::T: ToPrimitive,
E: From<Error>,
impl<'a, C, T, E> Scheduler<'a, C, T, E> where
C: Clock,
C::T: ToPrimitive,
E: From<Error>,
Auto Trait Implementations
impl<'a, C, T, E> RefUnwindSafe for Scheduler<'a, C, T, E> where
C: RefUnwindSafe,
impl<'a, C, T, E> Send for Scheduler<'a, C, T, E> where
C: Send,
impl<'a, C, T, E> Sync for Scheduler<'a, C, T, E> where
C: Sync,
impl<'a, C, T, E> Unpin for Scheduler<'a, C, T, E> where
C: Unpin,
impl<'a, C, T, E = Error> !UnwindSafe for Scheduler<'a, C, T, E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self is actually part of its subset T (and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.