aboutsummaryrefslogtreecommitdiff
path: root/tests/stm32/src/bin/ble.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-05-23 01:15:22 +0000
committerGitHub <[email protected]>2023-05-23 01:15:22 +0000
commit1fdde8f03fc8b98c7fdb91a94e2dfd47bcbc24cb (patch)
treeb28d26b4a54ecccce2de498e5106fc55be631061 /tests/stm32/src/bin/ble.rs
parentab7d129e152a9450b2a6445397365bcb3a3ce183 (diff)
parent64092169e3133b572626c1efa106963139a63b3f (diff)
Merge #1457
1457: TL Mbox read and write for stm32wb r=xoviat a=OueslatiGhaith Hello, This pull request is related to #1397 and #1401, inspired by #24, built upon the work done in #1405 and #1424, and was tested on an stm32wb55rg. This pull request aims to add read and write functionality to the TL mailbox for stm32wb microcontrollers Co-authored-by: goueslati <[email protected]> Co-authored-by: xoviat <[email protected]>
Diffstat (limited to 'tests/stm32/src/bin/ble.rs')
-rw-r--r--tests/stm32/src/bin/ble.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/stm32/src/bin/ble.rs b/tests/stm32/src/bin/ble.rs
index f4c864c65..aedf9a380 100644
--- a/tests/stm32/src/bin/ble.rs
+++ b/tests/stm32/src/bin/ble.rs
@@ -7,6 +7,7 @@
7#[path = "../example_common.rs"] 7#[path = "../example_common.rs"]
8mod example_common; 8mod example_common;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_stm32::interrupt;
10use embassy_stm32::ipcc::{Config, Ipcc}; 11use embassy_stm32::ipcc::{Config, Ipcc};
11use embassy_stm32::tl_mbox::TlMbox; 12use embassy_stm32::tl_mbox::TlMbox;
12use embassy_time::{Duration, Timer}; 13use embassy_time::{Duration, Timer};
@@ -20,12 +21,15 @@ async fn main(_spawner: Spawner) {
20 let config = Config::default(); 21 let config = Config::default();
21 let mut ipcc = Ipcc::new(p.IPCC, config); 22 let mut ipcc = Ipcc::new(p.IPCC, config);
22 23
23 let mbox = TlMbox::init(&mut ipcc); 24 let rx_irq = interrupt::take!(IPCC_C1_RX);
25 let tx_irq = interrupt::take!(IPCC_C1_TX);
26
27 let mbox = TlMbox::init(&mut ipcc, rx_irq, tx_irq);
24 28
25 loop { 29 loop {
26 let wireless_fw_info = mbox.wireless_fw_info(); 30 let wireless_fw_info = mbox.wireless_fw_info();
27 match wireless_fw_info { 31 match wireless_fw_info {
28 None => error!("not yet initialized"), 32 None => {}
29 Some(fw_info) => { 33 Some(fw_info) => {
30 let version_major = fw_info.version_major(); 34 let version_major = fw_info.version_major();
31 let version_minor = fw_info.version_minor(); 35 let version_minor = fw_info.version_minor();
@@ -43,7 +47,7 @@ async fn main(_spawner: Spawner) {
43 } 47 }
44 } 48 }
45 49
46 Timer::after(Duration::from_millis(500)).await; 50 Timer::after(Duration::from_millis(50)).await;
47 } 51 }
48 52
49 info!("Test OK"); 53 info!("Test OK");