diff options
| author | goueslati <[email protected]> | 2023-05-15 10:34:52 +0100 |
|---|---|---|
| committer | goueslati <[email protected]> | 2023-05-15 10:34:52 +0100 |
| commit | a8953b5c669da3403437e012a3d106b100e2a1f4 (patch) | |
| tree | 58122deeb24827979d378ec7dd677b7659c570ec | |
| parent | d97724cca3164250118c732759f403f4f94d4629 (diff) | |
cleanup
| -rw-r--r-- | embassy-stm32/src/tl_mbox/evt.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/embassy-stm32/src/tl_mbox/evt.rs b/embassy-stm32/src/tl_mbox/evt.rs index 8ae2a2559..0ecd4dab6 100644 --- a/embassy-stm32/src/tl_mbox/evt.rs +++ b/embassy-stm32/src/tl_mbox/evt.rs | |||
| @@ -95,39 +95,6 @@ impl EvtBox { | |||
| 95 | /// writes an underlying [`EvtPacket`] into the provided buffer. Returns the number of bytes that were | 95 | /// writes an underlying [`EvtPacket`] into the provided buffer. Returns the number of bytes that were |
| 96 | /// written. Returns an error if event kind is unkown or if provided buffer size is not enough | 96 | /// written. Returns an error if event kind is unkown or if provided buffer size is not enough |
| 97 | pub fn copy_into_slice(&self, buf: &mut [u8]) -> Result<usize, ()> { | 97 | pub fn copy_into_slice(&self, buf: &mut [u8]) -> Result<usize, ()> { |
| 98 | // TODO: double check this | ||
| 99 | // unsafe { | ||
| 100 | // let evt_kind = TlPacketType::try_from((*self.ptr).evt_serial.kind)?; | ||
| 101 | |||
| 102 | // if let TlPacketType::AclData = evt_kind { | ||
| 103 | // let acl_data: *const AclDataPacket = self.ptr.cast(); | ||
| 104 | // let acl_serial: *const AclDataSerial = &(*acl_data).acl_data_serial; | ||
| 105 | // let acl_serial_buf: *const u8 = acl_serial.cast(); | ||
| 106 | |||
| 107 | // let len = (*acl_serial).length as usize + 5; | ||
| 108 | // if len > buf.len() { | ||
| 109 | // return Err(()); | ||
| 110 | // } | ||
| 111 | |||
| 112 | // core::ptr::copy(acl_serial_buf, buf.as_mut_ptr(), len); | ||
| 113 | |||
| 114 | // Ok(len) | ||
| 115 | // } else { | ||
| 116 | // let evt_data: *const EvtPacket = self.ptr.cast(); | ||
| 117 | // let evt_serial: *const EvtSerial = &(*evt_data).evt_serial; | ||
| 118 | // let evt_serial_buf: *const u8 = evt_serial.cast(); | ||
| 119 | |||
| 120 | // let len = (*evt_serial).evt.payload_len as usize + TL_EVT_HEADER_SIZE; | ||
| 121 | // if len > buf.len() { | ||
| 122 | // return Err(()); | ||
| 123 | // } | ||
| 124 | |||
| 125 | // core::ptr::copy(evt_serial_buf, buf.as_mut_ptr(), len); | ||
| 126 | |||
| 127 | // Ok(len) | ||
| 128 | // } | ||
| 129 | // } | ||
| 130 | |||
| 131 | unsafe { | 98 | unsafe { |
| 132 | let evt_kind = TlPacketType::try_from((*self.ptr).evt_serial.kind)?; | 99 | let evt_kind = TlPacketType::try_from((*self.ptr).evt_serial.kind)?; |
| 133 | 100 | ||
