mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
Create Enum containing all tasks
This commit is contained in:
parent
6c1f4a7b5d
commit
37ee3a47af
1 changed files with 17 additions and 0 deletions
|
@ -126,6 +126,20 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
let user_code = app.user_code.clone();
|
let user_code = app.user_code.clone();
|
||||||
let name = &app.name;
|
let name = &app.name;
|
||||||
let device = extra.device;
|
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!(
|
quote!(
|
||||||
#(#user)*
|
#(#user)*
|
||||||
|
|
||||||
|
@ -141,6 +155,9 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
|
|
||||||
#(#root_software_tasks)*
|
#(#root_software_tasks)*
|
||||||
|
|
||||||
|
/// Unused
|
||||||
|
#(#tasks)*
|
||||||
|
|
||||||
/// Implementation details
|
/// Implementation details
|
||||||
mod #name {
|
mod #name {
|
||||||
/// Always include the device crate which contains the vector table
|
/// Always include the device crate which contains the vector table
|
||||||
|
|
Loading…
Reference in a new issue