platform: rewrite the platform-specific display creation traits into a new Board trait that also supports tasks
This commit is contained in:
@@ -4,9 +4,19 @@ pub mod embedded_graphics_lib;
|
||||
#[cfg(feature="smart-leds")]
|
||||
pub mod smart_leds_lib;
|
||||
|
||||
use crate::render::{Surface, Output};
|
||||
pub mod esp32;
|
||||
|
||||
pub trait DisplayInit {
|
||||
use esp_idf_svc::hal::prelude::Peripherals;
|
||||
|
||||
use crate::render::{Output, Surfaces};
|
||||
use crate::task::Task;
|
||||
|
||||
pub trait Board {
|
||||
type Output: Output;
|
||||
fn new_display<S: Surface>() -> Self::Output;
|
||||
}
|
||||
type Surfaces: Surfaces;
|
||||
|
||||
fn new(peripherals: Peripherals) -> Self;
|
||||
fn output(&mut self) -> Self::Output;
|
||||
fn surfaces(&mut self) -> Self::Surfaces;
|
||||
fn system_tasks(&mut self) -> Vec<Box<dyn Task>>;
|
||||
}
|
Reference in New Issue
Block a user