#[cfg(feature = "rp2040")]
pub mod rp2040;
pub mod storage;
#[cfg(feature = "rp2040")]
pub use rp2040::Rp2040;
pub use storage::Storage;
use crate::DynContext;
use core::any::Any;
use embassy_executor::Spawner;
pub trait Mcu: Any {}
pub trait McuInit {
type Config;
fn create(config: Self::Config, spawner: Spawner) -> Self
where
Self: Sized;
fn run(&'static self, context: DynContext);
}
pub trait HeapSize {
const DEFAULT_HEAP_SIZE: usize;
}
#[doc(hidden)]
pub use dummy::DummyMcu;
mod dummy {
use super::*;
pub struct DummyMcu;
impl Mcu for DummyMcu {}
impl McuInit for DummyMcu {
type Config = ();
fn create(_config: Self::Config, _spawner: Spawner) -> Self
where
Self: Sized,
{
Self
}
fn run(&'static self, _context: DynContext) {}
}
impl HeapSize for DummyMcu {
const DEFAULT_HEAP_SIZE: usize = 0;
}
}