aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-04-17 00:13:34 +0200
committerDario Nieuwenhuis <[email protected]>2023-04-17 17:52:02 +0200
commite14fa11fc35c1b163d86404935d180b9ef88e461 (patch)
tree8a3a449e4130de6b25eca901741106e86a4b8a79
parentdf7ef1d98f48a18027f5f0dcd0bc39cef0bfe8b9 (diff)
stm32/sdmmc: remove unneeded pointer casts.
-rw-r--r--embassy-stm32/src/sdmmc/mod.rs25
1 files changed, 12 insertions, 13 deletions
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs
index 92c54d815..22b578dcf 100644
--- a/embassy-stm32/src/sdmmc/mod.rs
+++ b/embassy-stm32/src/sdmmc/mod.rs
@@ -793,7 +793,7 @@ impl SdmmcInner {
793 let on_drop = OnDrop::new(|| unsafe { self.on_drop() }); 793 let on_drop = OnDrop::new(|| unsafe { self.on_drop() });
794 794
795 unsafe { 795 unsafe {
796 self.prepare_datapath_read(buffer as *mut [u32; 128], 512, 9, data_transfer_timeout, dma); 796 self.prepare_datapath_read(buffer, 512, 9, data_transfer_timeout, dma);
797 self.data_interrupts(true); 797 self.data_interrupts(true);
798 } 798 }
799 self.cmd(Cmd::read_single_block(address), true)?; 799 self.cmd(Cmd::read_single_block(address), true)?;
@@ -1121,7 +1121,7 @@ impl SdmmcInner {
1121 let on_drop = OnDrop::new(|| unsafe { self.on_drop() }); 1121 let on_drop = OnDrop::new(|| unsafe { self.on_drop() });
1122 1122
1123 unsafe { 1123 unsafe {
1124 self.prepare_datapath_read(&mut status as *mut [u32; 16], 64, 6, data_transfer_timeout, dma); 1124 self.prepare_datapath_read(&mut status, 64, 6, data_transfer_timeout, dma);
1125 self.data_interrupts(true); 1125 self.data_interrupts(true);
1126 } 1126 }
1127 self.cmd(Cmd::cmd6(set_function), true)?; // CMD6 1127 self.cmd(Cmd::cmd6(set_function), true)?; // CMD6
@@ -1202,7 +1202,7 @@ impl SdmmcInner {
1202 let on_drop = OnDrop::new(|| unsafe { self.on_drop() }); 1202 let on_drop = OnDrop::new(|| unsafe { self.on_drop() });
1203 1203
1204 unsafe { 1204 unsafe {
1205 self.prepare_datapath_read(&mut status as *mut [u32; 16], 64, 6, data_transfer_timeout, dma); 1205 self.prepare_datapath_read(&mut status, 64, 6, data_transfer_timeout, dma);
1206 self.data_interrupts(true); 1206 self.data_interrupts(true);
1207 } 1207 }
1208 self.cmd(Cmd::card_status(0), true)?; 1208 self.cmd(Cmd::card_status(0), true)?;
@@ -1320,7 +1320,7 @@ impl SdmmcInner {
1320 let on_drop = OnDrop::new(move || unsafe { self.on_drop() }); 1320 let on_drop = OnDrop::new(move || unsafe { self.on_drop() });
1321 1321
1322 unsafe { 1322 unsafe {
1323 self.prepare_datapath_read(&mut scr as *mut [u32], 8, 3, data_transfer_timeout, dma); 1323 self.prepare_datapath_read(&mut scr[..], 8, 3, data_transfer_timeout, dma);
1324 self.data_interrupts(true); 1324 self.data_interrupts(true);
1325 } 1325 }
1326 self.cmd(Cmd::cmd51(), true)?; 1326 self.cmd(Cmd::cmd51(), true)?;
@@ -1560,15 +1560,14 @@ pin_trait!(D5Pin, Instance);
1560pin_trait!(D6Pin, Instance); 1560pin_trait!(D6Pin, Instance);
1561pin_trait!(D7Pin, Instance); 1561pin_trait!(D7Pin, Instance);
1562 1562
1563cfg_if::cfg_if! { 1563#[cfg(sdmmc_v1)]
1564 if #[cfg(sdmmc_v1)] { 1564dma_trait!(SdmmcDma, Instance);
1565 dma_trait!(SdmmcDma, Instance); 1565
1566 } else if #[cfg(sdmmc_v2)] { 1566// SDMMCv2 uses internal DMA
1567 // SDMMCv2 uses internal DMA 1567#[cfg(sdmmc_v2)]
1568 pub trait SdmmcDma<T: Instance> {} 1568pub trait SdmmcDma<T: Instance> {}
1569 impl<T: Instance> SdmmcDma<T> for NoDma {} 1569#[cfg(sdmmc_v2)]
1570 } 1570impl<T: Instance> SdmmcDma<T> for NoDma {}
1571}
1572 1571
1573cfg_if::cfg_if! { 1572cfg_if::cfg_if! {
1574 // TODO, these could not be implemented, because required clocks are not exposed in RCC: 1573 // TODO, these could not be implemented, because required clocks are not exposed in RCC: