From c9a0bad57af00a6fc37a11a5ac8f9af78afd80e6 Mon Sep 17 00:00:00 2001 From: Sachymetsu Date: Mon, 13 Jul 2026 09:52:26 +0200 Subject: [PATCH] Tweak receiver loop --- Cargo.lock | 103 ---------------------------------------------------- Cargo.toml | 2 +- src/ble.rs | 4 +- src/main.rs | 7 +++- 4 files changed, 7 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71e46b3..73569ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -138,12 +138,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "bumpalo" -version = "3.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" - [[package]] name = "bytemuck" version = "1.25.0" @@ -199,15 +193,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa" -[[package]] -name = "convert_case" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "cordyceps" version = "0.3.4" @@ -863,7 +848,6 @@ dependencies = [ "futures-sink", "futures-task", "pin-project-lite", - "slab", ] [[package]] @@ -963,17 +947,6 @@ dependencies = [ "either", ] -[[package]] -name = "js-sys" -version = "0.3.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" -dependencies = [ - "cfg-if", - "futures-util", - "wasm-bindgen", -] - [[package]] name = "keccak" version = "0.1.6" @@ -1533,12 +1506,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - [[package]] name = "smallvec" version = "1.15.2" @@ -1755,24 +1722,9 @@ dependencies = [ "heapless 0.9.3", "rand_core 0.6.4", "static_cell", - "trouble-host-macros", "zerocopy", ] -[[package]] -name = "trouble-host-macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d809ae05f510cf8f1d863749281eb28e049d9ae4ad52d92ea7a0ac068a0e17c" -dependencies = [ - "convert_case", - "darling", - "proc-macro2", - "quote", - "syn 2.0.118", - "uuid", -] - [[package]] name = "typenum" version = "1.20.1" @@ -1785,12 +1737,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-segmentation" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" - [[package]] name = "unicode-width" version = "0.1.14" @@ -1808,10 +1754,6 @@ name = "uuid" version = "1.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" -dependencies = [ - "js-sys", - "wasm-bindgen", -] [[package]] name = "valuable" @@ -1856,51 +1798,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wasm-bindgen" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.118", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" -dependencies = [ - "unicode-ident", -] - [[package]] name = "winapi-util" version = "0.1.11" diff --git a/Cargo.toml b/Cargo.toml index f01ce4f..02c81b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ embassy-rp = { version = "0.10.0", features = [ embassy-futures = { version = "0.1.2" } cyw43 = { version = "0.7.0", features = ["firmware-logs", "bluetooth"] } cyw43-pio = { version = "0.10.0" } -trouble-host = { version = "0.6.0", features = ["default-packet-pool"] } +trouble-host = { version = "0.6.0", default-features = false, features = ["peripheral", "default-packet-pool"] } [profile.dev] debug = true diff --git a/src/ble.rs b/src/ble.rs index 2f11c25..6ffa88a 100644 --- a/src/ble.rs +++ b/src/ble.rs @@ -86,15 +86,13 @@ pub async fn run(spawner: Spawner, controller: ExternalController error!("BLE ERROR: {}", e), _ => {} diff --git a/src/main.rs b/src/main.rs index e8e7a26..c16ce7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ use embassy_rp::{ peripherals::{DMA_CH0, PIO0}, pio::{InterruptHandler, Pio}, }; -use portable_atomic::AtomicU32; +use portable_atomic::AtomicPtr; use sachy_fmt::{info, unwrap}; use static_cell::StaticCell; use trouble_host::prelude::ExternalController; @@ -42,7 +42,10 @@ fn main() -> ! { info!("Welcome to Sachy Water!"); info!("Initialising Heap, SIZE: {}", HEAP_SIZE); unwrap!(HEAP.init()); - info!("LOCK FREE ATOMICS? {}", AtomicU32::is_always_lock_free()); + info!( + "LOCK FREE ATOMICS? {}", + AtomicPtr::<()>::is_always_lock_free() + ); let pwr = Output::new(p.PIN_23, Level::Low); let cs = Output::new(p.PIN_25, Level::High); -- 2.51.2