diff --git a/examples/resource.rs b/examples/resource.rs index 30b453e191a47a9f74345eea88f0beb87e3c2686..f1d0fffb140588a787fb4815bcb65609340c9528 100644 --- a/examples/resource.rs +++ b/examples/resource.rs @@ -29,18 +29,21 @@ app! { EXTI1: { path: exti1, priority: 1, + interarrival: 100, resources: [X, Y], }, EXTI2: { path: exti2, priority: 3, + interarrival: 40, resources: [Y], }, EXTI3: { path: exti3, priority: 2, + interarrival: 30, resources: [X], }, }, diff --git a/gdb.py b/gdb.py index ae430f65fc2f209a3e141d140dc50d8efb699c97..817bd7f5db36fc12fb413e1864aa60af4ca28b95 100644 --- a/gdb.py +++ b/gdb.py @@ -26,6 +26,7 @@ object_index_current = 0 tasks = [] priorities = [] +interarrival = [] task_name = "" file_name = "" @@ -573,6 +574,7 @@ if debug: """ Split into tasks and priorities """ for x in task_list: + interarrival.append(x.pop()) priorities.append(x.pop()) tasks.append(x.pop()) @@ -584,6 +586,9 @@ print("At priorities:") for t in priorities: print(t) +print("At interarrivals:") +for t in interarrival: + print(t) """ Subscribe stop_event_ignore to Breakpoint notifications """ gdb.events.stop.connect(stop_event) diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 617f77ce036a771bb14018cca436873692616005..2bad5b81a41ab353c4ef606a765445fbb422d6d8 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -9,12 +9,18 @@ name = "cortex-m-rtfm-macros" repository = "https://github.com/japaric/cortex-m-rtfm" version = "0.3.0" + [dependencies] error-chain = "0.10.0" quote = "0.3.15" -rtfm-syntax = "0.2.1" +#rtfm-syntax = "0.2.1" +#rtfm-syntax = { path = "../../rtfm-syntax", version = "0.2.1" } +rtfm-syntax = { git = "https://github.com/perlindgren/rtfm-syntax.git", version = "0.2.2" } syn = "0.11.11" +#[replace] +#"rtfm-syntax:0.2.1" = { path = '../../rtfm-syntax' } + [dependencies.klee] path = "../klee" diff --git a/macros/src/check.rs b/macros/src/check.rs index f6fd9cc60923570a11a3be8af7e55e3fe8b3cac3..58e0bc2efcd96735a67f63eca504ac5d3af747ae 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -51,6 +51,7 @@ pub struct Task { pub kind: Kind, pub path: Path, pub priority: u8, + pub interarrival: u32, pub resources: Resources, } @@ -165,6 +166,7 @@ fn task(name: &str, task: syntax::check::Task) -> Result<Task> { kind, path: task.path.ok_or("`path` field is missing")?, priority: task.priority.unwrap_or(1), + interarrival: task.interarrival.unwrap_or(1), resources: task.resources, }) } diff --git a/macros/src/lib.rs b/macros/src/lib.rs index f2d63c8d11ec3457b07c514e2757184945d1f2b5..b65f963288fe8cc4330931ced42295023e923b31 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -194,7 +194,7 @@ fn run(ts: TokenStream) -> Result<TokenStream> { let mut tasks = Vec::new(); for (id, task) in app.tasks { println!("{}", id); - tasks.push(format!("{} {}", id, task.priority)); + tasks.push(format!("{} {} {}", id, task.priority, task.interarrival)); } let path = Path::new("klee/tasks.txt");