mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-01 16:04:33 +01:00
don't wrap static references in a Static
This commit is contained in:
parent
6ea9cda663
commit
f5a4d8e904
4 changed files with 10 additions and 19 deletions
|
@ -3,16 +3,12 @@ set -ex
|
||||||
main() {
|
main() {
|
||||||
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
|
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
|
||||||
cargo build
|
cargo build
|
||||||
cargo test
|
cargo test --tests
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xargo build --target $TARGET
|
xargo build --target $TARGET
|
||||||
for ex in $(ls examples/*); do
|
xargo test --target $TARGET --examples
|
||||||
ex=$(basename $ex)
|
|
||||||
ex=${ex%.*}
|
|
||||||
xargo build --target $TARGET --example $ex
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
@ -47,9 +47,9 @@ fn init_(_p: init::Peripherals, _r: init::Resources) {}
|
||||||
|
|
||||||
fn idle_(t: &mut Threshold, mut r: idle::Resources) -> ! {
|
fn idle_(t: &mut Threshold, mut r: idle::Resources) -> ! {
|
||||||
loop {
|
loop {
|
||||||
**r.OWNED != **r.OWNED;
|
*r.OWNED != *r.OWNED;
|
||||||
|
|
||||||
if **r.OWNED {
|
if *r.OWNED {
|
||||||
if r.SHARED.claim(t, |shared, _| **shared) {
|
if r.SHARED.claim(t, |shared, _| **shared) {
|
||||||
rtfm::wfi();
|
rtfm::wfi();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,9 @@ mod main {
|
||||||
|
|
||||||
pub fn idle(t: &mut Threshold, mut r: ::idle::Resources) -> ! {
|
pub fn idle(t: &mut Threshold, mut r: ::idle::Resources) -> ! {
|
||||||
loop {
|
loop {
|
||||||
**r.OWNED != **r.OWNED;
|
*r.OWNED != *r.OWNED;
|
||||||
|
|
||||||
if **r.OWNED {
|
if *r.OWNED {
|
||||||
if r.SHARED.claim(t, |shared, _| **shared) {
|
if r.SHARED.claim(t, |shared, _| **shared) {
|
||||||
rtfm::wfi();
|
rtfm::wfi();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,24 +91,19 @@ fn idle(
|
||||||
let ty = &resource.ty;
|
let ty = &resource.ty;
|
||||||
|
|
||||||
rfields.push(quote! {
|
rfields.push(quote! {
|
||||||
pub #name: &'static mut ::#krate::Static<#ty>,
|
pub #name: &'static mut #ty,
|
||||||
});
|
});
|
||||||
|
|
||||||
rexprs.push(quote! {
|
rexprs.push(quote! {
|
||||||
#name: #krate::Static::ref_mut(
|
#name: &mut #super_::#name,
|
||||||
&mut #super_::#name,
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
rfields.push(quote! {
|
rfields.push(quote! {
|
||||||
pub #name:
|
pub #name: &'static mut ::#device::#name,
|
||||||
&'static mut ::#krate::Static<::#device::#name>,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
rexprs.push(quote! {
|
rexprs.push(quote! {
|
||||||
#name: ::#krate::Static::ref_mut(
|
#name: &mut *::#device::#name.get(),
|
||||||
&mut *::#device::#name.get(),
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue