Skip to content

Commit

Permalink
fix(stm32): fix the executor-interrupt mode (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 authored Sep 19, 2024
2 parents afbed18 + 5eddc90 commit 76f5a90
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions laze-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ modules:
FEATURES:
- riot-rs/executor-single-thread

# Enabled for architectures that provide a dedicated software interrupt (SWI),
# and thus do not require to sacrifice another, arbitrarily-chosen peripheral
# interrupt.
- name: executor-interrupt
help: use the Embassy interrupt executor
context:
Expand Down
1 change: 1 addition & 0 deletions src/riot-rs-embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ executor-single-thread = [
executor-interrupt = [
"riot-rs-nrf/executor-interrupt",
"riot-rs-rp/executor-interrupt",
"riot-rs-stm32/executor-interrupt",
]
executor-thread = ["threading"]
executor-none = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
if let Ok(var) = env::var("CONFIG_SWI") {
fs::write(
&dest_path,
format!("crate::executor_swi!({});\n", var).as_bytes(),
format!("riot_rs_embassy_common::executor_swi!({});\n", var).as_bytes(),
)
.expect("write failed");
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/riot-rs-stm32/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ use {core::mem::MaybeUninit, embassy_stm32::SharedData};
#[cfg(capability = "hw/stm32-dual-core")]
static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit();

#[cfg(feature = "executor-interrupt")]
pub static EXECUTOR: Executor = Executor::new();

pub fn init() -> OptionalPeripherals {
let mut config = Config::default();
board_config(&mut config);
Expand Down

0 comments on commit 76f5a90

Please sign in to comment.