chore: replace deprecated bare-metal with critical-section

This commit is contained in:
Oleksandr Babak 2025-10-28 13:44:17 +01:00 committed by Henrik Tjäder
parent 299382c86c
commit 511e2247d0
6 changed files with 16 additions and 16 deletions

View file

@ -5,7 +5,7 @@ signature `fn(init::Context) -> (Shared, Local)`, where `Shared` and `Local` are
The `init` task executes after system reset, [after an optionally defined `pre-init` code section][^pre-init] and an always occurring internal RTIC initialization. The `init` task executes after system reset, [after an optionally defined `pre-init` code section][^pre-init] and an always occurring internal RTIC initialization.
The `init` and optional `pre-init` tasks runs _with interrupts disabled_ and have exclusive access to Cortex-M (the `bare_metal::CriticalSection` token is available as `cs`). The `init` and optional `pre-init` tasks runs _with interrupts disabled_ and have exclusive access to Cortex-M (the `critical_section::CriticalSection` token is available as `cs`).
Device specific peripherals are available through the `core` and `device` fields of `init::Context`. Device specific peripherals are available through the `core` and `device` fields of `init::Context`.

View file

@ -20,12 +20,6 @@ dependencies = [
"rustc_version", "rustc_version",
] ]
[[package]]
name = "bare-metal"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603"
[[package]] [[package]]
name = "bitfield" name = "bitfield"
version = "0.13.2" version = "0.13.2"
@ -59,7 +53,7 @@ version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9"
dependencies = [ dependencies = [
"bare-metal 0.2.5", "bare-metal",
"bitfield", "bitfield",
"critical-section", "critical-section",
"embedded-hal 0.2.7", "embedded-hal 0.2.7",
@ -270,6 +264,16 @@ dependencies = [
"stable_deref_trait", "stable_deref_trait",
] ]
[[package]]
name = "heapless"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
dependencies = [
"hash32",
"stable_deref_trait",
]
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.1.0" version = "2.1.0"
@ -459,7 +463,6 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
name = "rtic" name = "rtic"
version = "2.2.0" version = "2.2.0"
dependencies = [ dependencies = [
"bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic", "portable-atomic",
@ -511,7 +514,7 @@ dependencies = [
"embedded-hal 1.0.0", "embedded-hal 1.0.0",
"embedded-hal-async", "embedded-hal-async",
"embedded-hal-bus", "embedded-hal-bus",
"heapless", "heapless 0.9.1",
"loom", "loom",
"portable-atomic", "portable-atomic",
"rtic-common", "rtic-common",
@ -533,12 +536,11 @@ dependencies = [
name = "rtic_lm3s6965" name = "rtic_lm3s6965"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bare-metal 1.0.0",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"cortex-m-semihosting", "cortex-m-semihosting",
"futures", "futures",
"heapless", "heapless 0.8.0",
"lm3s6965", "lm3s6965",
"panic-semihosting", "panic-semihosting",
"rtic", "rtic",

View file

@ -12,7 +12,6 @@ edition = "2021"
heapless = "0.8" heapless = "0.8"
lm3s6965 = "0.2" lm3s6965 = "0.2"
cortex-m = "0.7.0" cortex-m = "0.7.0"
bare-metal = "1.0.0"
cortex-m-semihosting = "0.5.0" cortex-m-semihosting = "0.5.0"
rtic-time = { path = "../../rtic-time" } rtic-time = { path = "../../rtic-time" }
rtic-sync = { path = "../../rtic-sync" } rtic-sync = { path = "../../rtic-sync" }

View file

@ -31,7 +31,7 @@ mod app {
// Access to the critical section token, // Access to the critical section token,
// to indicate that this is a critical section // to indicate that this is a critical section
let _cs_token: bare_metal::CriticalSection = cx.cs; let _cs_token: rtic::export::CriticalSection = cx.cs;
hprintln!("init"); hprintln!("init");

View file

@ -30,7 +30,6 @@ esp32c3 = { version = "0.30.0", optional = true }
esp32c6 = { version = "0.21.0", optional = true } esp32c6 = { version = "0.21.0", optional = true }
riscv = { version = "0.15.0", optional = true } riscv = { version = "0.15.0", optional = true }
cortex-m = { version = "0.7.0", optional = true } cortex-m = { version = "0.7.0", optional = true }
bare-metal = "1.0.0"
portable-atomic = { version = "1", default-features = false } portable-atomic = { version = "1", default-features = false }
rtic-macros = { path = "../rtic-macros", version = "=2.2.0" } rtic-macros = { path = "../rtic-macros", version = "=2.2.0" }
rtic-core = "1" rtic-core = "1"

View file

@ -1,4 +1,4 @@
pub use bare_metal::CriticalSection; pub use critical_section::CriticalSection;
pub use portable_atomic as atomic; pub use portable_atomic as atomic;
pub mod executor; pub mod executor;