Skip to content
Snippets Groups Projects
Commit 904e6664 authored by Per Lindgren's avatar Per Lindgren
Browse files

exam v1

parent a21de008
No related branches found
No related tags found
No related merge requests found
......@@ -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],
},
},
......
......@@ -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)
......
......@@ -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"
......
......@@ -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,
})
}
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment