aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32wb
diff options
context:
space:
mode:
authorgoueslati <[email protected]>2023-07-13 16:29:29 +0100
committergoueslati <[email protected]>2023-07-13 16:29:29 +0100
commitf90b170dad91848d5a0ff746d873bd8a4ce7e91f (patch)
treedcad430269b866f795376cb7f9859ac160e57fe9 /examples/stm32wb
parent68792bb9188b69c1e7629425a0d39110c602b9b2 (diff)
cleanup
Diffstat (limited to 'examples/stm32wb')
-rw-r--r--examples/stm32wb/.cargo/config.toml4
-rw-r--r--examples/stm32wb/src/bin/mac_ffd.rs10
-rw-r--r--examples/stm32wb/src/bin/mac_rfd.rs2
3 files changed, 10 insertions, 6 deletions
diff --git a/examples/stm32wb/.cargo/config.toml b/examples/stm32wb/.cargo/config.toml
index cf62a10a0..51c499ee7 100644
--- a/examples/stm32wb/.cargo/config.toml
+++ b/examples/stm32wb/.cargo/config.toml
@@ -1,7 +1,7 @@
1[target.'cfg(all(target_arch = "arm", target_os = "none"))'] 1[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2# replace STM32WB55CCUx with your chip as listed in `probe-rs chip list` 2# replace STM32WB55CCUx with your chip as listed in `probe-rs chip list`
3runner = "probe-run --chip STM32WB55RGVx --speed 1000 --connect-under-reset" 3# runner = "probe-run --chip STM32WB55RGVx --speed 1000 --connect-under-reset"
4# runner = "teleprobe local run --chip STM32WB55RG --elf" 4runner = "teleprobe local run --chip STM32WB55RG --elf"
5 5
6[build] 6[build]
7target = "thumbv7em-none-eabihf" 7target = "thumbv7em-none-eabihf"
diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs
index 37d36fcdd..689a28353 100644
--- a/examples/stm32wb/src/bin/mac_ffd.rs
+++ b/examples/stm32wb/src/bin/mac_ffd.rs
@@ -168,9 +168,13 @@ async fn main(spawner: Spawner) {
168 .unwrap(), 168 .unwrap(),
169 MacEvent::McpsDataInd(data_ind) => { 169 MacEvent::McpsDataInd(data_ind) => {
170 let data_addr = data_ind.msdu_ptr; 170 let data_addr = data_ind.msdu_ptr;
171 let mut a = [0u8; 256]; 171 let mut data = [0u8; 256];
172 unsafe { data_addr.copy_to(&mut a as *mut _, data_ind.msdu_length as usize) } 172 unsafe { data_addr.copy_to(&mut data as *mut _, data_ind.msdu_length as usize) }
173 info!("{}", a[..data_ind.msdu_length as usize]) 173 info!("{}", data[..data_ind.msdu_length as usize]);
174
175 if &data[..data_ind.msdu_length as usize] == b"Hello from embassy!" {
176 info!("success");
177 }
174 } 178 }
175 _ => {} 179 _ => {}
176 } 180 }
diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs
index 756709132..ea349f9a8 100644
--- a/examples/stm32wb/src/bin/mac_rfd.rs
+++ b/examples/stm32wb/src/bin/mac_rfd.rs
@@ -148,7 +148,7 @@ async fn main(spawner: Spawner) {
148 .send_command(&DataRequest { 148 .send_command(&DataRequest {
149 src_addr_mode: AddressMode::Short, 149 src_addr_mode: AddressMode::Short,
150 dst_addr_mode: AddressMode::Short, 150 dst_addr_mode: AddressMode::Short,
151 dst_pan_id: PanId::BROADCAST, 151 dst_pan_id: PanId([0x1A, 0xAA]),
152 dst_address: MacAddress::BROADCAST, 152 dst_address: MacAddress::BROADCAST,
153 msdu_handle: 0x02, 153 msdu_handle: 0x02,
154 ack_tx: 0x00, 154 ack_tx: 0x00,