task: move Scheduler into a trait, define static-sized scheduler implementation, expose as a system task runner in platform

This commit is contained in:
2024-12-02 19:32:18 +01:00
parent 132d7c0a33
commit f789f6ded9
4 changed files with 41 additions and 31 deletions

View File

@@ -9,14 +9,15 @@ pub mod esp32;
pub type DefaultBoard = esp32::Esp32Board;
use crate::render::{Output, Surfaces};
use crate::task::Task;
use crate::task::Scheduler;
pub trait Board {
type Output: Output;
type Surfaces: Surfaces;
type Scheduler: Scheduler;
fn take() -> Self;
fn output(&mut self) -> Self::Output;
fn surfaces(&mut self) -> Self::Surfaces;
fn system_tasks(&mut self) -> Vec<Box<dyn Task>>;
fn system_tasks(&mut self) -> Self::Scheduler;
}