mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 20:22:51 +01:00
fix idle::Resources::new
it assumed that all resources were "early" resources
This commit is contained in:
parent
a190da3e3f
commit
2415a640af
2 changed files with 13 additions and 2 deletions
|
@ -32,6 +32,11 @@ app! {
|
||||||
static PORT: u16;
|
static PORT: u16;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
idle: {
|
||||||
|
// Test that late resources can be used in idle
|
||||||
|
resources: [IP_ADDRESS],
|
||||||
|
}
|
||||||
|
|
||||||
tasks: {
|
tasks: {
|
||||||
SYS_TICK: {
|
SYS_TICK: {
|
||||||
priority: 1,
|
priority: 1,
|
||||||
|
|
|
@ -74,8 +74,14 @@ fn idle(
|
||||||
});
|
});
|
||||||
|
|
||||||
let _name = Ident::new(format!("_{}", name.as_ref()));
|
let _name = Ident::new(format!("_{}", name.as_ref()));
|
||||||
rexprs.push(quote! {
|
rexprs.push(if resource.expr.is_some() {
|
||||||
#name: &mut #super_::#_name,
|
quote! {
|
||||||
|
#name: &mut #super_::#_name,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
quote! {
|
||||||
|
#name: #super_::#_name.as_mut(),
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
rfields.push(quote! {
|
rfields.push(quote! {
|
||||||
|
|
Loading…
Reference in a new issue