Skip to content
Snippets Groups Projects
Commit 2415a640 authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

fix `idle::Resources::new`

it assumed that all resources were "early" resources
parent a190da3e
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,11 @@ app! {
static PORT: u16;
},
idle: {
// Test that late resources can be used in idle
resources: [IP_ADDRESS],
}
tasks: {
SYS_TICK: {
priority: 1,
......
......@@ -74,8 +74,14 @@ fn idle(
});
let _name = Ident::new(format!("_{}", name.as_ref()));
rexprs.push(quote! {
rexprs.push(if resource.expr.is_some() {
quote! {
#name: &mut #super_::#_name,
}
} else {
quote! {
#name: #super_::#_name.as_mut(),
}
});
} else {
rfields.push(quote! {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment