aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/local_resources_struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/codegen/local_resources_struct.rs')
-rw-r--r--macros/src/codegen/local_resources_struct.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/macros/src/codegen/local_resources_struct.rs b/macros/src/codegen/local_resources_struct.rs
index b7eae3f9..ed5577c9 100644
--- a/macros/src/codegen/local_resources_struct.rs
+++ b/macros/src/codegen/local_resources_struct.rs
@@ -13,7 +13,13 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
let resources = match ctxt {
Context::Init => &app.init.args.local_resources,
- Context::Idle => &app.idle.as_ref().unwrap().args.local_resources,
+ Context::Idle => {
+ &app.idle
+ .as_ref()
+ .expect("RTIC-ICE: unable to get idle name")
+ .args
+ .local_resources
+ }
Context::HardwareTask(name) => &app.hardware_tasks[name].args.local_resources,
Context::SoftwareTask(name) => &app.software_tasks[name].args.local_resources,
};