Upgrade static-cell to v2.0

This commit is contained in:
Dario Nieuwenhuis 2023-11-02 21:52:07 +01:00
parent d6f42eafad
commit 1f51367eb9
29 changed files with 37 additions and 32 deletions

View file

@ -62,7 +62,6 @@ embassy-macros = { version = "0.2.1", path = "../embassy-macros" }
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true} embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true}
atomic-polyfill = "1.0.1" atomic-polyfill = "1.0.1"
critical-section = "1.1" critical-section = "1.1"
static_cell = "1.1"
# arch-cortex-m dependencies # arch-cortex-m dependencies
cortex-m = { version = "0.7.6", optional = true } cortex-m = { version = "0.7.6", optional = true }

View file

@ -47,7 +47,6 @@ pub use spawner::*;
pub mod _export { pub mod _export {
#[cfg(feature = "rtos-trace")] #[cfg(feature = "rtos-trace")]
pub use rtos_trace::trace; pub use rtos_trace::trace;
pub use static_cell::StaticCell;
/// Expands the given block of code when `embassy-executor` is compiled with /// Expands the given block of code when `embassy-executor` is compiled with
/// the `rtos-trace-interrupt` feature. /// the `rtos-trace-interrupt` feature.

View file

@ -53,8 +53,7 @@ pub fn wasm() -> TokenStream {
quote! { quote! {
#[wasm_bindgen::prelude::wasm_bindgen(start)] #[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn main() -> Result<(), wasm_bindgen::JsValue> { pub fn main() -> Result<(), wasm_bindgen::JsValue> {
static EXECUTOR: ::embassy_executor::_export::StaticCell<::embassy_executor::Executor> = ::embassy_executor::_export::StaticCell::new(); let executor = ::std::boxed::Box::leak(::std::boxed::Box::new(::embassy_executor::Executor::new()));
let executor = EXECUTOR.init(::embassy_executor::Executor::new());
executor.start(|spawner| { executor.start(|spawner| {
spawner.spawn(__embassy_main(spawner)).unwrap(); spawner.spawn(__embassy_main(spawner)).unwrap();

View file

@ -95,4 +95,4 @@ rp2040-boot2 = "0.3"
[dev-dependencies] [dev-dependencies]
embassy-executor = { version = "0.3.1", path = "../embassy-executor", features = ["nightly", "arch-std", "executor-thread"] } embassy-executor = { version = "0.3.1", path = "../embassy-executor", features = ["nightly", "arch-std", "executor-thread"] }
static_cell = "1.1" static_cell = { version = "2" }

View file

@ -45,4 +45,4 @@ futures-util = { version = "0.3.17", features = [ "channel" ] }
# Enable critical-section implementation for std, for tests # Enable critical-section implementation for std, for tests
critical-section = { version = "1.1", features = ["std"] } critical-section = { version = "1.1", features = ["std"] }
static_cell = "1.1" static_cell = { version = "2" }

View file

@ -13,6 +13,6 @@ embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
embassy-sync = { version = "0.4.0", path = "../embassy-sync" } embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
embassy-futures = { version = "0.1.0", path = "../embassy-futures" } embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
futures = { version = "0.3", default-features = false } futures = { version = "0.3", default-features = false }
static_cell = "1" static_cell = { version = "2" }
usbd-hid = "0.6.0" usbd-hid = "0.6.0"
log = "0.4" log = "0.4"

View file

@ -48,7 +48,7 @@ defmt = "0.3"
defmt-rtt = "0.4" defmt-rtt = "0.4"
fixed = "1.10.0" fixed = "1.10.0"
static_cell = "1.1" static_cell = { version = "2" }
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rt = "0.7.0" cortex-m-rt = "0.7.0"
panic-probe = { version = "0.3", features = ["print-defmt"] } panic-probe = { version = "0.3", features = ["print-defmt"] }

View file

@ -42,7 +42,7 @@ embedded-io-async = { version = "0.6.0" }
defmt = "0.3" defmt = "0.3"
defmt-rtt = "0.4" defmt-rtt = "0.4"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rt = "0.7.0" cortex-m-rt = "0.7.0"
panic-probe = { version = "0.3", features = ["print-defmt"] } panic-probe = { version = "0.3", features = ["print-defmt"] }

View file

@ -47,7 +47,8 @@ embedded-hal-async = "1.0.0-rc.1"
embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] } embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] }
embedded-io-async = { version = "0.6.0", features = ["defmt-03"] } embedded-io-async = { version = "0.6.0", features = ["defmt-03"] }
embedded-storage = { version = "0.3" } embedded-storage = { version = "0.3" }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
portable-atomic = { version = "1.5", features = ["critical-section"] }
log = "0.4" log = "0.4"
pio-proc = "0.2" pio-proc = "0.2"
pio = "0.2.1" pio = "0.2.1"

View file

@ -24,7 +24,7 @@ nix = "0.26.2"
clap = { version = "3.0.0-beta.5", features = ["derive"] } clap = { version = "3.0.0-beta.5", features = ["derive"] }
rand_core = { version = "0.6.3", features = ["std"] } rand_core = { version = "0.6.3", features = ["std"] }
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -17,7 +17,8 @@ panic-probe = "0.3"
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] }
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -24,7 +24,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
nb = "1.0.0" nb = "1.0.0"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -23,4 +23,4 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
nb = "1.0.0" nb = "1.0.0"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}

View file

@ -27,7 +27,7 @@ heapless = { version = "0.7.5", default-features = false }
nb = "1.0.0" nb = "1.0.0"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
micromath = "2.0.0" micromath = "2.0.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
chrono = { version = "^0.4", default-features = false} chrono = { version = "^0.4", default-features = false}
[profile.release] [profile.release]

View file

@ -27,7 +27,7 @@ nb = "1.0.0"
rand_core = "0.6.3" rand_core = "0.6.3"
critical-section = "1.1" critical-section = "1.1"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -20,6 +20,7 @@ embedded-hal = "0.2.6"
panic-probe = { version = "0.3", features = ["print-defmt"] } panic-probe = { version = "0.3", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] }
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -31,7 +31,7 @@ critical-section = "1.1"
micromath = "2.0.0" micromath = "2.0.0"
stm32-fmc = "0.3.0" stm32-fmc = "0.3.0"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
# cargo build/run # cargo build/run
[profile.dev] [profile.dev]

View file

@ -31,7 +31,7 @@ critical-section = "1.1"
micromath = "2.0.0" micromath = "2.0.0"
stm32-fmc = "0.3.0" stm32-fmc = "0.3.0"
embedded-storage = "0.3.0" embedded-storage = "0.3.0"
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
chrono = { version = "^0.4", default-features = false } chrono = { version = "^0.4", default-features = false }
# cargo build/run # cargo build/run

View file

@ -33,7 +33,8 @@ panic-probe = { version = "0.3", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
embedded-hal = "0.2.6" embedded-hal = "0.2.6"
static_cell = "1.1" static_cell = { version = "2" }
portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] }
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -32,7 +32,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
chrono = { version = "^0.4", default-features = false } chrono = { version = "^0.4", default-features = false }
rand = { version = "0.8.5", default-features = false } rand = { version = "0.8.5", default-features = false }
static_cell = {version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
micromath = "2.0.0" micromath = "2.0.0"

View file

@ -26,7 +26,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
rand_core = { version = "0.6.3", default-features = false } rand_core = { version = "0.6.3", default-features = false }
embedded-io-async = { version = "0.6.0" } embedded-io-async = { version = "0.6.0" }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -22,7 +22,7 @@ embedded-hal = "0.2.6"
panic-probe = { version = "0.3", features = ["print-defmt"] } panic-probe = { version = "0.3", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[features] [features]
default = ["ble", "mac"] default = ["ble", "mac"]

View file

@ -20,7 +20,7 @@ embedded-hal = "0.2.6"
panic-probe = { version = "0.3", features = ["print-defmt"] } panic-probe = { version = "0.3", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
heapless = { version = "0.7.5", default-features = false } heapless = { version = "0.7.5", default-features = false }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
[profile.release] [profile.release]
debug = 2 debug = 2

View file

@ -18,7 +18,7 @@ embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-host
embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] } embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] }
embedded-hal-async = { version = "1.0.0-rc.1" } embedded-hal-async = { version = "1.0.0-rc.1" }
embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] } embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] }
static_cell = { version = "1.1", features = [ "nightly" ] } static_cell = { version = "2", features = [ "nightly" ] }
perf-client = { path = "../perf-client" } perf-client = { path = "../perf-client" }
defmt = "0.3" defmt = "0.3"

View file

@ -31,7 +31,8 @@ panic-probe = { version = "0.3.0", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
embedded-io-async = { version = "0.6.0" } embedded-io-async = { version = "0.6.0" }
embedded-storage = { version = "0.3" } embedded-storage = { version = "0.3" }
static_cell = { version = "1.1", features = ["nightly"]} static_cell = { version = "2", features = ["nightly"]}
portable-atomic = { version = "1.5", features = ["critical-section"] }
pio = "0.2" pio = "0.2"
pio-proc = "0.2" pio-proc = "0.2"
rand = { version = "0.8.5", default-features = false } rand = { version = "0.8.5", default-features = false }

View file

@ -5,12 +5,12 @@ teleprobe_meta::target!(b"rpi-pico");
use defmt::{info, unwrap}; use defmt::{info, unwrap};
use embassy_executor::Executor; use embassy_executor::Executor;
use embassy_executor::_export::StaticCell;
use embassy_rp::gpio::{Input, Level, Output, Pull}; use embassy_rp::gpio::{Input, Level, Output, Pull};
use embassy_rp::multicore::{spawn_core1, Stack}; use embassy_rp::multicore::{spawn_core1, Stack};
use embassy_rp::peripherals::{PIN_0, PIN_1}; use embassy_rp::peripherals::{PIN_0, PIN_1};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel; use embassy_sync::channel::Channel;
use static_cell::StaticCell;
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
static mut CORE1_STACK: Stack<1024> = Stack::new(); static mut CORE1_STACK: Stack<1024> = Stack::new();

View file

@ -5,12 +5,12 @@ teleprobe_meta::target!(b"rpi-pico");
use defmt::{assert_eq, info, panic, unwrap}; use defmt::{assert_eq, info, panic, unwrap};
use embassy_executor::Executor; use embassy_executor::Executor;
use embassy_executor::_export::StaticCell;
use embassy_rp::multicore::{spawn_core1, Stack}; use embassy_rp::multicore::{spawn_core1, Stack};
use embassy_rp::peripherals::{I2C0, I2C1}; use embassy_rp::peripherals::{I2C0, I2C1};
use embassy_rp::{bind_interrupts, i2c, i2c_slave}; use embassy_rp::{bind_interrupts, i2c, i2c_slave};
use embedded_hal_1::i2c::Operation; use embedded_hal_1::i2c::Operation;
use embedded_hal_async::i2c::I2c; use embedded_hal_async::i2c::I2c;
use static_cell::StaticCell;
use {defmt_rtt as _, panic_probe as _, panic_probe as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _, panic_probe as _, panic_probe as _};
static mut CORE1_STACK: Stack<1024> = Stack::new(); static mut CORE1_STACK: Stack<1024> = Stack::new();

View file

@ -5,10 +5,10 @@ teleprobe_meta::target!(b"rpi-pico");
use defmt::{info, unwrap}; use defmt::{info, unwrap};
use embassy_executor::Executor; use embassy_executor::Executor;
use embassy_executor::_export::StaticCell;
use embassy_rp::multicore::{spawn_core1, Stack}; use embassy_rp::multicore::{spawn_core1, Stack};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel; use embassy_sync::channel::Channel;
use static_cell::StaticCell;
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
static mut CORE1_STACK: Stack<1024> = Stack::new(); static mut CORE1_STACK: Stack<1024> = Stack::new();

View file

@ -8,8 +8,8 @@ autobins = false
[features] [features]
stm32f103c8 = ["embassy-stm32/stm32f103c8", "not-gpdma"] stm32f103c8 = ["embassy-stm32/stm32f103c8", "not-gpdma"]
stm32f429zi = ["embassy-stm32/stm32f429zi", "chrono", "eth", "stop", "can", "not-gpdma", "dac-adc-pin", "rng"] stm32f429zi = ["embassy-stm32/stm32f429zi", "chrono", "eth", "stop", "can", "not-gpdma", "dac-adc-pin", "rng"]
stm32g071rb = ["embassy-stm32/stm32g071rb", "not-gpdma", "dac-adc-pin"] stm32g071rb = ["embassy-stm32/stm32g071rb", "cm0", "not-gpdma", "dac-adc-pin"]
stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] stm32c031c6 = ["embassy-stm32/stm32c031c6", "cm0", "not-gpdma"]
stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "not-gpdma", "rng"] stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "not-gpdma", "rng"]
stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac-adc-pin", "rng"] stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac-adc-pin", "rng"]
stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng"] stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng"]
@ -19,7 +19,7 @@ stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth", "rng"]
stm32u585ai = ["embassy-stm32/stm32u585ai", "chrono", "rng"] stm32u585ai = ["embassy-stm32/stm32u585ai", "chrono", "rng"]
stm32u5a5zj = ["embassy-stm32/stm32u5a5zj", "chrono", "rng"] stm32u5a5zj = ["embassy-stm32/stm32u5a5zj", "chrono", "rng"]
stm32wba52cg = ["embassy-stm32/stm32wba52cg", "chrono", "rng"] stm32wba52cg = ["embassy-stm32/stm32wba52cg", "chrono", "rng"]
stm32l073rz = ["embassy-stm32/stm32l073rz", "not-gpdma", "rng"] stm32l073rz = ["embassy-stm32/stm32l073rz", "cm0", "not-gpdma", "rng"]
stm32l152re = ["embassy-stm32/stm32l152re", "chrono", "not-gpdma"] stm32l152re = ["embassy-stm32/stm32l152re", "chrono", "not-gpdma"]
stm32l4a6zg = ["embassy-stm32/stm32l4a6zg", "chrono", "not-gpdma", "rng"] stm32l4a6zg = ["embassy-stm32/stm32l4a6zg", "chrono", "not-gpdma", "rng"]
stm32l4r5zi = ["embassy-stm32/stm32l4r5zi", "chrono", "not-gpdma", "rng"] stm32l4r5zi = ["embassy-stm32/stm32l4r5zi", "chrono", "not-gpdma", "rng"]
@ -42,6 +42,8 @@ embassy-stm32-wpan = []
not-gpdma = [] not-gpdma = []
dac-adc-pin = [] dac-adc-pin = []
cm0 = ["portable-atomic/unsafe-assume-single-core"]
[dependencies] [dependencies]
teleprobe-meta = "1" teleprobe-meta = "1"
@ -66,7 +68,8 @@ micromath = "2.0.0"
panic-probe = { version = "0.3.0", features = ["print-defmt"] } panic-probe = { version = "0.3.0", features = ["print-defmt"] }
rand_core = { version = "0.6", default-features = false } rand_core = { version = "0.6", default-features = false }
rand_chacha = { version = "0.3", default-features = false } rand_chacha = { version = "0.3", default-features = false }
static_cell = {version = "1.1", features = ["nightly"] } static_cell = { version = "2", features = ["nightly"] }
portable-atomic = { version = "1.5", features = [] }
chrono = { version = "^0.4", default-features = false, optional = true} chrono = { version = "^0.4", default-features = false, optional = true}