initial commit: hsmc v0.2 with during: activities
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
This commit is contained in:
56 files changed
+11770
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//! t10.1: a single `during:` listing the same field twice is a compile error.
|
||||
use hsmc::statechart;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Ev { Halt }
|
||||
|
||||
pub struct Ctx {
|
||||
pub a: u32,
|
||||
}
|
||||
|
||||
statechart! {
|
||||
M {
|
||||
context: Ctx;
|
||||
events: Ev;
|
||||
default(S);
|
||||
terminate(Halt);
|
||||
|
||||
state S {
|
||||
during: tick(a, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn tick(_: &mut u32, _: &mut u32) -> Ev { Ev::Halt }
|
||||
|
||||
impl MActions for MActionContext<'_> {}
|
||||
|
||||
fn main() {}
|
||||
Reference in new issue
Block a user