riscv support
This commit is contained in:
@ -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 = []
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user