diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-24 18:00:48 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-24 18:00:48 +0000 |
| commit | 3bb94469f4efebee04f2d8e5f380c1cfbc967ad6 (patch) | |
| tree | ef172ceec423f9b98c3f1019088fff0a9f511a7e | |
| parent | ef7500681287dce37d40888825248d33f900b719 (diff) | |
| parent | 4abacac2522b93a7f1d44c353b81f5f5054ed7cc (diff) | |
Merge pull request #4447 from clubby789/gatt-mm
stm32/wb: Add memory manager to GATT example
| -rw-r--r-- | examples/stm32wb/src/bin/gatt_server.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/stm32wb/src/bin/gatt_server.rs b/examples/stm32wb/src/bin/gatt_server.rs index 041dc0cf5..9864fa026 100644 --- a/examples/stm32wb/src/bin/gatt_server.rs +++ b/examples/stm32wb/src/bin/gatt_server.rs | |||
| @@ -27,6 +27,7 @@ use embassy_stm32_wpan::hci::vendor::event::{self, AttributeHandle, VendorEvent} | |||
| 27 | use embassy_stm32_wpan::hci::{BdAddr, Event}; | 27 | use embassy_stm32_wpan::hci::{BdAddr, Event}; |
| 28 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; | 28 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; |
| 29 | use embassy_stm32_wpan::sub::ble::Ble; | 29 | use embassy_stm32_wpan::sub::ble::Ble; |
| 30 | use embassy_stm32_wpan::sub::mm; | ||
| 30 | use embassy_stm32_wpan::TlMbox; | 31 | use embassy_stm32_wpan::TlMbox; |
| 31 | use {defmt_rtt as _, panic_probe as _}; | 32 | use {defmt_rtt as _, panic_probe as _}; |
| 32 | 33 | ||
| @@ -38,7 +39,7 @@ bind_interrupts!(struct Irqs{ | |||
| 38 | const BLE_GAP_DEVICE_NAME_LENGTH: u8 = 7; | 39 | const BLE_GAP_DEVICE_NAME_LENGTH: u8 = 7; |
| 39 | 40 | ||
| 40 | #[embassy_executor::main] | 41 | #[embassy_executor::main] |
| 41 | async fn main(_spawner: Spawner) { | 42 | async fn main(spawner: Spawner) { |
| 42 | /* | 43 | /* |
| 43 | How to make this work: | 44 | How to make this work: |
| 44 | 45 | ||
| @@ -70,6 +71,7 @@ async fn main(_spawner: Spawner) { | |||
| 70 | let config = Config::default(); | 71 | let config = Config::default(); |
| 71 | let mut mbox = TlMbox::init(p.IPCC, Irqs, config); | 72 | let mut mbox = TlMbox::init(p.IPCC, Irqs, config); |
| 72 | 73 | ||
| 74 | spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap(); | ||
| 73 | let sys_event = mbox.sys_subsystem.read().await; | 75 | let sys_event = mbox.sys_subsystem.read().await; |
| 74 | info!("sys event: {}", sys_event.payload()); | 76 | info!("sys event: {}", sys_event.payload()); |
| 75 | 77 | ||
| @@ -221,6 +223,11 @@ async fn main(_spawner: Spawner) { | |||
| 221 | } | 223 | } |
| 222 | } | 224 | } |
| 223 | 225 | ||
| 226 | #[embassy_executor::task] | ||
| 227 | async fn run_mm_queue(memory_manager: mm::MemoryManager) { | ||
| 228 | memory_manager.run_queue().await; | ||
| 229 | } | ||
| 230 | |||
| 224 | fn get_bd_addr() -> BdAddr { | 231 | fn get_bd_addr() -> BdAddr { |
| 225 | let mut bytes = [0u8; 6]; | 232 | let mut bytes = [0u8; 6]; |
| 226 | 233 | ||
