Skip to content

Commit

Permalink
rp/multicore: enable fpu on second core only if building for -eabihf …
Browse files Browse the repository at this point in the history
…targets.
  • Loading branch information
Dirbaio committed Oct 13, 2024
1 parent cdcd9de commit 7e91261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions embassy-rp/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ fn main() {

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=link-rp.x.in");

println!("cargo:rustc-check-cfg=cfg(has_fpu)");
if target.ends_with("-eabihf") {
println!("cargo:rustc-cfg=has_fpu");
}
}
}
2 changes: 1 addition & 1 deletion embassy-rp/src/multicore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ where
};

// Enable FPU
#[cfg(feature = "_rp235x")]
#[cfg(all(feature = "_rp235x", has_fpu))]
unsafe {
let p = cortex_m::Peripherals::steal();
p.SCB.cpacr.modify(|cpacr| cpacr | (3 << 20) | (3 << 22));
Expand Down

0 comments on commit 7e91261

Please sign in to comment.