From 70d16799e6fc1bb80c32a1a95559e608158f9c2f Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Tue, 28 Jan 2025 19:30:26 +0000 Subject: [PATCH] Fix the build for esp32c6 and other esps with CAS --- examples/esp/Cargo.toml | 14 +++++++------- rs-matter-embassy/src/ble.rs | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/esp/Cargo.toml b/examples/esp/Cargo.toml index df6dc1c..378d262 100644 --- a/examples/esp/Cargo.toml +++ b/examples/esp/Cargo.toml @@ -35,7 +35,7 @@ embassy-sync = "0.6" embassy-futures = "0.1" embassy-time = "0.4" static_cell = "2" -portable-atomic = { version = "1", features = ["unsafe-assume-single-core"] } +portable-atomic = "1" [features] default = ["esp32c3"] @@ -53,12 +53,12 @@ default = ["esp32c3"] # # [1]: https://github.com/embassy-rs/trouble/pull/236#issuecomment-2586457641 # -esp32 = ["esp-hal/esp32", "esp-backtrace/esp32", "esp-hal-embassy/esp32", "esp-println/esp32", "esp-wifi/esp32"] -esp32c2 = ["esp-hal/esp32c2", "esp-backtrace/esp32c2", "esp-hal-embassy/esp32c2", "esp-println/esp32c2", "esp-wifi/esp32c2"] -esp32c3 = ["esp-hal/esp32c3", "esp-backtrace/esp32c3", "esp-hal-embassy/esp32c3", "esp-println/esp32c3", "esp-wifi/esp32c3"] -esp32c6 = ["esp-hal/esp32c6", "esp-backtrace/esp32c6", "esp-hal-embassy/esp32c6", "esp-println/esp32c6", "esp-wifi/esp32c6"] -esp32h2 = ["esp-hal/esp32h2", "esp-backtrace/esp32h2", "esp-hal-embassy/esp32h2", "esp-println/esp32h2", "esp-wifi/esp32h2"] -esp32s3 = ["esp-hal/esp32s3", "esp-backtrace/esp32s3", "esp-hal-embassy/esp32s3", "esp-println/esp32s3", "esp-wifi/esp32s3"] +esp32 = ["esp-hal/esp32", "esp-backtrace/esp32", "esp-hal-embassy/esp32", "esp-println/esp32", "esp-wifi/esp32", "portable-atomic/critical-section"] +esp32c2 = ["esp-hal/esp32c2", "esp-backtrace/esp32c2", "esp-hal-embassy/esp32c2", "esp-println/esp32c2", "esp-wifi/esp32c2", "portable-atomic/critical-section"] +esp32c3 = ["esp-hal/esp32c3", "esp-backtrace/esp32c3", "esp-hal-embassy/esp32c3", "esp-println/esp32c3", "esp-wifi/esp32c3", "portable-atomic/unsafe-assume-single-core"] +esp32c6 = ["esp-hal/esp32c6", "esp-backtrace/esp32c6", "esp-hal-embassy/esp32c6", "esp-println/esp32c6", "esp-wifi/esp32c6", "portable-atomic/critical-section"] +esp32h2 = ["esp-hal/esp32h2", "esp-backtrace/esp32h2", "esp-hal-embassy/esp32h2", "esp-println/esp32h2", "esp-wifi/esp32h2", "portable-atomic/critical-section"] +esp32s3 = ["esp-hal/esp32s3", "esp-backtrace/esp32s3", "esp-hal-embassy/esp32s3", "esp-println/esp32s3", "esp-wifi/esp32s3", "portable-atomic/critical-section"] [profile.dev] # Rust debug is too slow. diff --git a/rs-matter-embassy/src/ble.rs b/rs-matter-embassy/src/ble.rs index 94001ed..7cd6711 100644 --- a/rs-matter-embassy/src/ble.rs +++ b/rs-matter-embassy/src/ble.rs @@ -34,7 +34,9 @@ use trouble_host::prelude::*; use trouble_host::{self, Address, BleHostError, Controller, HostResources}; const MAX_CONNECTIONS: usize = MAX_BTP_SESSIONS; -const MAX_MTU_SIZE: usize = 251; // For now 512; // TODO const L2CAP_MTU: usize = 251; +// esp32c6 has a bug so we can't go lower than 255 +// TODO: Make the MTU size a feature in future +const MAX_MTU_SIZE: usize = 255; const MAX_CHANNELS: usize = 2; const ADV_SETS: usize = 1;