From fe1e7c4d7660163457226316ffbf30f6f3c8ddc5 Mon Sep 17 00:00:00 2001
From: xoviat <xoviat@users.noreply.github.com>
Date: Sun, 16 Jul 2023 18:07:05 -0500
Subject: [PATCH] wpan: fix datarequest

---
 embassy-stm32-wpan/src/mac/commands.rs    | 2 +-
 embassy-stm32-wpan/src/mac/indications.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/embassy-stm32-wpan/src/mac/commands.rs b/embassy-stm32-wpan/src/mac/commands.rs
index 8acae24bb..8f6dcbbbc 100644
--- a/embassy-stm32-wpan/src/mac/commands.rs
+++ b/embassy-stm32-wpan/src/mac/commands.rs
@@ -370,7 +370,7 @@ pub struct DataRequest {
 
 impl DataRequest {
     pub fn set_buffer<'a>(&'a mut self, buf: &'a [u8]) -> &mut Self {
-        self.msdu_ptr = &buf as *const _ as *const u8;
+        self.msdu_ptr = buf as *const _ as *const u8;
         self.msdu_length = buf.len() as u8;
 
         self
diff --git a/embassy-stm32-wpan/src/mac/indications.rs b/embassy-stm32-wpan/src/mac/indications.rs
index cf795dfa0..98826e662 100644
--- a/embassy-stm32-wpan/src/mac/indications.rs
+++ b/embassy-stm32-wpan/src/mac/indications.rs
@@ -237,7 +237,7 @@ impl ParseableMacEvent for DataIndication {}
 
 impl DataIndication {
     pub fn payload<'a>(&'a self) -> &'a [u8] {
-        unsafe { slice::from_raw_parts(self.msdu_ptr as *const _ as *const u8, self.msdu_length as usize) }
+        unsafe { slice::from_raw_parts(self.msdu_ptr, self.msdu_length as usize) }
     }
 }