aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32wb/src/bin
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-07-09 16:01:13 -0500
committerxoviat <[email protected]>2023-07-09 16:01:13 -0500
commitc1bf5aee247060a0251fe13eefcb3c7369f44eb9 (patch)
tree8f2ad3b639d3f0bace111b720041166aaa0984be /examples/stm32wb/src/bin
parent735d676a725999eda3869e7323c6264c2e8c2cb9 (diff)
mac: move table initialization after sys ready
Diffstat (limited to 'examples/stm32wb/src/bin')
-rw-r--r--examples/stm32wb/src/bin/tl_mbox_mac.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs
index f67be4682..5931c392b 100644
--- a/examples/stm32wb/src/bin/tl_mbox_mac.rs
+++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs
@@ -6,6 +6,7 @@ use defmt::*;
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_stm32::bind_interrupts; 7use embassy_stm32::bind_interrupts;
8use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; 8use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler};
9use embassy_stm32_wpan::sub::mm;
9use embassy_stm32_wpan::TlMbox; 10use embassy_stm32_wpan::TlMbox;
10use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
11 12
@@ -14,8 +15,13 @@ bind_interrupts!(struct Irqs{
14 IPCC_C1_TX => TransmitInterruptHandler; 15 IPCC_C1_TX => TransmitInterruptHandler;
15}); 16});
16 17
18#[embassy_executor::task]
19async fn run_mm_queue(memory_manager: mm::MemoryManager) {
20 memory_manager.run_queue().await;
21}
22
17#[embassy_executor::main] 23#[embassy_executor::main]
18async fn main(_spawner: Spawner) { 24async fn main(spawner: Spawner) {
19 /* 25 /*
20 How to make this work: 26 How to make this work:
21 27
@@ -46,9 +52,13 @@ async fn main(_spawner: Spawner) {
46 let config = Config::default(); 52 let config = Config::default();
47 let mbox = TlMbox::init(p.IPCC, Irqs, config); 53 let mbox = TlMbox::init(p.IPCC, Irqs, config);
48 54
55 spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap();
56
49 let sys_event = mbox.sys_subsystem.read().await; 57 let sys_event = mbox.sys_subsystem.read().await;
50 info!("sys event: {}", sys_event.payload()); 58 info!("sys event: {}", sys_event.payload());
51 59
60 core::mem::drop(sys_event);
61
52 let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; 62 let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await;
53 info!("initialized mac: {}", result); 63 info!("initialized mac: {}", result);
54 64