misc fixes

This commit is contained in:
Jorge Aparicio 2017-07-20 23:47:14 -05:00
parent c64e7decfe
commit bf4eabf287

View file

@ -130,7 +130,7 @@ fn idle(
}); });
rexprs.push(quote! { rexprs.push(quote! {
#name: ::krate::Static::ref_mut( #name: ::#krate::Static::ref_mut(
&mut *::#device::#name.get(), &mut *::#device::#name.get(),
), ),
}); });
@ -423,16 +423,16 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
fn borrow<'cs>( fn borrow<'cs>(
&'cs self, &'cs self,
_cs: &'cs #krate::CriticalSection, _cs: &'cs #krate::CriticalSection,
) -> &'cs #krate::Static<#name> { ) -> &'cs #krate::Static<#device::#name> {
unsafe { #krate::Static::ref_(&*#name.get()) } unsafe { #krate::Static::ref_(&*#device::#name.get()) }
} }
fn borrow_mut<'cs>( fn borrow_mut<'cs>(
&'cs mut self, &'cs mut self,
_cs: &'cs #krate::CriticalSection, _cs: &'cs #krate::CriticalSection,
) -> &'cs mut #krate::Static<#name> { ) -> &'cs mut #krate::Static<#device::#name> {
unsafe { unsafe {
#krate::Static::ref_mut(&mut *#name.get()) #krate::Static::ref_mut(&mut *#device::#name.get())
} }
} }
@ -443,7 +443,7 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
) -> R ) -> R
where where
F: FnOnce( F: FnOnce(
&#krate::Static<#name>, &#krate::Static<#device::#name>,
&mut #krate::Threshold) -> R &mut #krate::Threshold) -> R
{ {
unsafe { unsafe {
@ -465,7 +465,7 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
) -> R ) -> R
where where
F: FnOnce( F: FnOnce(
&mut #krate::Static<#name>, &mut #krate::Static<#device::#name>,
&mut #krate::Threshold) -> R &mut #krate::Threshold) -> R
{ {
unsafe { unsafe {