schedule now works with RacyCell

This commit is contained in:
Per Lindgren 2021-03-11 12:30:26 +01:00
parent c70191c019
commit 3ace49f3eb
2 changed files with 3 additions and 2 deletions

View file

@ -304,8 +304,9 @@ pub fn codegen(
) -> Result<(), #ty> {
unsafe {
let input = #tupled;
if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.dequeue()) {
if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.get_mut_unchecked().dequeue()) {
#app_path::#inputs
.get_mut_unchecked()
.get_unchecked_mut(usize::from(index))
.as_mut_ptr()
.write(input);

View file

@ -107,7 +107,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
quote!(
#(#cfgs)*
#t::#name => {
rtic::export::interrupt::free(|_| #rq.split().0.enqueue_unchecked((#rqt::#name, index)));
rtic::export::interrupt::free(|_| #rq.get_mut_unchecked().split().0.enqueue_unchecked((#rqt::#name, index)));
#pend
}