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: C
The clock used for timing.
tick: u16
The current tick, incremented each run.
max_task_slowdown: u8
The maximum amount of ticks a task can miss before slowing down the scheduler.
loop_rate_hz: i16
The desired loop rate to run (in hz).
task_not_achieved: u32
The amount of ticks with tasks that exceed the max_task_slowdown
.
task_all_achieved: u32
The amount of ticks with tasks that remain in the max_task_slowdown
.
loop_timer_start_us: u32
The start time of the run loop (in microseconds).
last_loop_time_s: f32
The start time of the run loop (in seconds).
extra_loop_us: u32
Extra time to spend in the loop to catch up on tasks not achieved (in microseconds).
Implementations§
Source§impl<'a, C, T, E> Scheduler<'a, C, T, E>
impl<'a, C, T, E> Scheduler<'a, C, T, E>
Auto Trait Implementations§
impl<'a, C, T, E> Freeze for Scheduler<'a, C, T, E>where
C: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more