mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
Fix fences
This commit is contained in:
parent
d27d0fe33f
commit
5c3cedf69a
2 changed files with 7 additions and 8 deletions
|
@ -101,7 +101,12 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> {
|
||||||
const PRIORITY: u8 = #level;
|
const PRIORITY: u8 = #level;
|
||||||
|
|
||||||
rtic::export::run(PRIORITY, || {
|
rtic::export::run(PRIORITY, || {
|
||||||
|
// Have the acquire/release semantics outside the checks to no overdo it
|
||||||
|
core::sync::atomic::fence(core::sync::atomic::Ordering::Acquire);
|
||||||
|
|
||||||
#(#stmts)*
|
#(#stmts)*
|
||||||
|
|
||||||
|
core::sync::atomic::fence(core::sync::atomic::Ordering::Release);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
|
@ -111,14 +111,8 @@ pub fn codegen(
|
||||||
|
|
||||||
let v = Vec::new();
|
let v = Vec::new();
|
||||||
let cfgs = match ctxt {
|
let cfgs = match ctxt {
|
||||||
Context::HardwareTask(t) => {
|
Context::HardwareTask(t) => &app.hardware_tasks[t].cfgs,
|
||||||
&app.hardware_tasks[t].cfgs
|
Context::SoftwareTask(t) => &app.software_tasks[t].cfgs,
|
||||||
// ...
|
|
||||||
}
|
|
||||||
Context::SoftwareTask(t) => {
|
|
||||||
&app.software_tasks[t].cfgs
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
_ => &v,
|
_ => &v,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue