371: task_local and lock_free r=korken89 a=AfoHT

Getting this going to test with GHA

For further discussion see https://github.com/rtic-rs/rfcs/issues/30

Co-authored-by: Per <Per Lindgren>
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
bors[bot] 2020-10-15 16:01:07 +00:00 committed by GitHub
commit 1cda9eaecc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 439 additions and 1 deletions

View file

@ -19,7 +19,8 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
proc-macro-error = "1"
quote = "1"
syn = "1"
rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax", branch = "master", version = "0.4.0" }
rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax", branch = "master", version = "0.5.0-alpha.0" }

View file

@ -126,6 +126,20 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
let user_code = app.user_code.clone();
let name = &app.name;
let device = extra.device;
// Get the list of all tasks
// Currently unused, might be useful
let task_list = analysis.tasks.clone();
let mut tasks = vec![];
if !task_list.is_empty() {
tasks.push(quote!(
enum Tasks {
#(#task_list),*
}
));
}
quote!(
#(#user)*
@ -141,6 +155,9 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
#(#root_software_tasks)*
/// Unused
#(#tasks)*
/// Implementation details
mod #name {
/// Always include the device crate which contains the vector table