diff options
author | 2023-01-08 21:10:06 +0100 | |
---|---|---|
committer | 2023-03-01 00:33:28 +0100 | |
commit | 6d252785e83218eeb5d080836281c90b86ca0e03 (patch) | |
tree | 7220026f04871b30fa01d3ddddd5d40c87f89f8b /macros/src/codegen/main.rs | |
parent | 35c97b61c17a30de675eb1c7f852a100b200a0c2 (diff) | |
download | rtic-6d252785e83218eeb5d080836281c90b86ca0e03.tar.gz rtic-6d252785e83218eeb5d080836281c90b86ca0e03.tar.zst rtic-6d252785e83218eeb5d080836281c90b86ca0e03.zip |
Support 0 prio tasks
Diffstat (limited to 'macros/src/codegen/main.rs')
-rw-r--r-- | macros/src/codegen/main.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/macros/src/codegen/main.rs b/macros/src/codegen/main.rs index 90f09ae0..8e7138f4 100644 --- a/macros/src/codegen/main.rs +++ b/macros/src/codegen/main.rs @@ -16,11 +16,14 @@ pub fn codegen(app: &App, analysis: &Analysis) -> TokenStream2 { let name = &idle.name; quote!(#name(#name::Context::new())) } else { - // TODO: No idle defined, check for 0-priority tasks and generate an executor if needed - - quote!(loop { - rtic::export::nop() - }) + if analysis.channels.get(&0).is_some() { + let dispatcher = util::zero_prio_dispatcher_ident(); + quote!(#dispatcher();) + } else { + quote!(loop { + rtic::export::nop() + }) + } }; let main = util::suffixed("main"); |