diff options
author | 2021-04-03 20:30:34 +0300 | |
---|---|---|
committer | 2021-07-09 18:44:19 +0300 | |
commit | e4319de3d526285381f5cc53e14f9a17d123a81a (patch) | |
tree | b8ed1d60401f508f97e8f4cf151b295f11b79d24 /macros/src/codegen/software_tasks.rs | |
parent | c67657371b9f27353caae8a8ccf6e94cd0f25110 (diff) | |
download | rtic-e4319de3d526285381f5cc53e14f9a17d123a81a.tar.gz rtic-e4319de3d526285381f5cc53e14f9a17d123a81a.tar.zst rtic-e4319de3d526285381f5cc53e14f9a17d123a81a.zip |
const generics
Diffstat (limited to 'macros/src/codegen/software_tasks.rs')
-rw-r--r-- | macros/src/codegen/software_tasks.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index cfd21e40..0b073359 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -32,8 +32,8 @@ pub fn codegen( let (_, _, _, input_ty) = util::regroup_inputs(inputs); let cap = task.args.capacity; - let cap_lit = util::capacity_literal(cap); - let cap_ty = util::capacity_typenum(cap, true); + let cap_lit = util::capacity_literal(cap as usize); + let cap_lit_p1 = util::capacity_literal(cap as usize + 1); // Create free queues and inputs / instants buffers let fq = util::fq_ident(name); @@ -41,10 +41,8 @@ pub fn codegen( let (fq_ty, fq_expr, mk_uninit): (_, _, Box<dyn Fn() -> Option<_>>) = { ( - quote!(rtic::export::SCFQ<#cap_ty>), - quote!(rtic::export::Queue(unsafe { - rtic::export::iQueue::u8_sc() - })), + quote!(rtic::export::SCFQ<#cap_lit_p1>), + quote!(rtic::export::Queue::new()), Box::new(|| util::link_section_uninit()), ) }; |