components/sched/
priority.rsuse core::mem::MaybeUninit;
use kernel::component::Component;
use kernel::scheduler::priority::PrioritySched;
#[macro_export]
macro_rules! priority_component_static {
() => {{
kernel::static_buf!(kernel::scheduler::priority::PrioritySched)
};};
}
pub struct PriorityComponent {
board_kernel: &'static kernel::Kernel,
}
impl PriorityComponent {
pub fn new(board_kernel: &'static kernel::Kernel) -> PriorityComponent {
PriorityComponent { board_kernel }
}
}
impl Component for PriorityComponent {
type StaticInput = &'static mut MaybeUninit<PrioritySched>;
type Output = &'static mut PrioritySched;
fn finalize(self, static_buffer: Self::StaticInput) -> Self::Output {
static_buffer.write(PrioritySched::new(self.board_kernel))
}
}