Hierarchical statechart codegen for Rust with: - during: activities for state-scoped concurrent I/O - field-list borrowing (split-borrow inside the run loop) - embassy-first async with tokio support - STATE_CHART const for tooling/inspection - examples: microwave, microwave_tui, embassy_full, during_radio
26 lines
355 B
Rust
26 lines
355 B
Rust
use hsmc::statechart;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum Ev { _U }
|
|
|
|
pub struct Ctx;
|
|
|
|
statechart! {
|
|
M {
|
|
context: Ctx;
|
|
events: Ev;
|
|
default(Parent);
|
|
state Parent {
|
|
default(Cousin);
|
|
state Child { entry: e; }
|
|
}
|
|
state Cousin { entry: e; }
|
|
}
|
|
}
|
|
|
|
impl MActions for MActionContext<'_> {
|
|
fn e(&mut self) {}
|
|
}
|
|
|
|
fn main() {}
|