diff options
| author | xoviat <[email protected]> | 2023-06-17 15:37:34 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-06-17 15:37:34 -0500 |
| commit | 443550b353c733aee7d122468a82df432014d8fe (patch) | |
| tree | b4b038a0c874b69a4113d021dab9d2dcf7ac36b9 /examples | |
| parent | 6d7d617f40399c5ffaa588f9e5dfefd34164c531 (diff) | |
stm32/wpan: use new ownership model
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32wb/src/bin/tl_mbox.rs | 2 | ||||
| -rw-r--r-- | examples/stm32wb/src/bin/tl_mbox_tx_rx.rs | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/examples/stm32wb/src/bin/tl_mbox.rs b/examples/stm32wb/src/bin/tl_mbox.rs index b010fdff1..9fc4b8aac 100644 --- a/examples/stm32wb/src/bin/tl_mbox.rs +++ b/examples/stm32wb/src/bin/tl_mbox.rs | |||
| @@ -48,7 +48,7 @@ async fn main(_spawner: Spawner) { | |||
| 48 | let mbox = TlMbox::init(p.IPCC, Irqs, config); | 48 | let mbox = TlMbox::init(p.IPCC, Irqs, config); |
| 49 | 49 | ||
| 50 | loop { | 50 | loop { |
| 51 | let wireless_fw_info = mbox.wireless_fw_info(); | 51 | let wireless_fw_info = mbox.sys_subsystem.wireless_fw_info(); |
| 52 | match wireless_fw_info { | 52 | match wireless_fw_info { |
| 53 | None => info!("not yet initialized"), | 53 | None => info!("not yet initialized"), |
| 54 | Some(fw_info) => { | 54 | Some(fw_info) => { |
diff --git a/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs b/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs index 84a4f78e4..439bd01ac 100644 --- a/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs +++ b/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs | |||
| @@ -6,8 +6,6 @@ use defmt::*; | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::bind_interrupts; | 7 | use embassy_stm32::bind_interrupts; |
| 8 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 8 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 9 | use embassy_stm32_wpan::ble::Ble; | ||
| 10 | use embassy_stm32_wpan::sys::Sys; | ||
| 11 | use embassy_stm32_wpan::TlMbox; | 9 | use embassy_stm32_wpan::TlMbox; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 11 | ||
| @@ -46,15 +44,18 @@ async fn main(_spawner: Spawner) { | |||
| 46 | info!("Hello World!"); | 44 | info!("Hello World!"); |
| 47 | 45 | ||
| 48 | let config = Config::default(); | 46 | let config = Config::default(); |
| 49 | let _ = TlMbox::init(p.IPCC, Irqs, config); | 47 | let mbox = TlMbox::init(p.IPCC, Irqs, config); |
| 50 | 48 | ||
| 51 | Sys::shci_c2_ble_init(Default::default()).await; | 49 | let sys_event = mbox.sys_subsystem.read().await; |
| 50 | info!("sys event: {}", sys_event.payload()); | ||
| 51 | |||
| 52 | mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; | ||
| 52 | 53 | ||
| 53 | info!("starting ble..."); | 54 | info!("starting ble..."); |
| 54 | Ble::write(0x0c, &[]).await; | 55 | mbox.ble_subsystem.write(0x0c, &[]).await; |
| 55 | 56 | ||
| 56 | info!("waiting for ble..."); | 57 | info!("waiting for ble..."); |
| 57 | let ble_event = Ble::read().await; | 58 | let ble_event = mbox.ble_subsystem.read().await; |
| 58 | 59 | ||
| 59 | info!("ble event: {}", ble_event.payload()); | 60 | info!("ble event: {}", ble_event.payload()); |
| 60 | 61 | ||
