riscv support

This commit is contained in:
Sijmen Woutersen
2022-09-25 20:10:11 +02:00
parent 059610a8de
commit 6e1120e17e
4 changed files with 16 additions and 16 deletions

View File

@ -25,6 +25,7 @@ flavors = [
default = []
std = ["embassy-macros/std", "critical-section/std"]
wasm = ["dep:wasm-bindgen", "dep:js-sys", "embassy-macros/wasm"]
riscv = ["embassy-macros/riscv"]
# Enable nightly-only features
nightly = []

View File

@ -54,20 +54,7 @@ impl Executor {
loop {
unsafe {
self.inner.poll();
// we do not care about race conditions between the load and store operations, interrupts
//will only set this value to true.
critical_section::with(|_| {
// if there is work to do, loop back to polling
// TODO can we relax this?
if SIGNAL_WORK_THREAD_MODE.load(Ordering::SeqCst) {
SIGNAL_WORK_THREAD_MODE.store(false, Ordering::SeqCst);
}
// if not, wait for interrupt
else {
core::arch::asm!("wfi");
}
});
// if an interrupt occurred while waiting, it will be serviced here
core::arch::asm!("wfi");
}
}
}