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