stm32/sdmmc: switch to AFIT.
This commit is contained in:
		@@ -55,7 +55,7 @@ cortex-m = "0.7.6"
 | 
				
			|||||||
futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
 | 
					futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
 | 
				
			||||||
rand_core = "0.6.3"
 | 
					rand_core = "0.6.3"
 | 
				
			||||||
sdio-host = "0.5.0"
 | 
					sdio-host = "0.5.0"
 | 
				
			||||||
embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "46d1b1c2ff13e31e282ec1e352421721694f126a", optional = true }
 | 
					embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true }
 | 
				
			||||||
critical-section = "1.1"
 | 
					critical-section = "1.1"
 | 
				
			||||||
atomic-polyfill = "1.0.1"
 | 
					atomic-polyfill = "1.0.1"
 | 
				
			||||||
stm32-metapac = "6"
 | 
					stm32-metapac = "6"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1651,8 +1651,6 @@ foreach_peripheral!(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[cfg(feature = "embedded-sdmmc")]
 | 
					#[cfg(feature = "embedded-sdmmc")]
 | 
				
			||||||
mod sdmmc_rs {
 | 
					mod sdmmc_rs {
 | 
				
			||||||
    use core::future::Future;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx};
 | 
					    use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    use super::*;
 | 
					    use super::*;
 | 
				
			||||||
@@ -1660,21 +1658,12 @@ mod sdmmc_rs {
 | 
				
			|||||||
    impl<'d, T: Instance, Dma: SdmmcDma<T>> BlockDevice for Sdmmc<'d, T, Dma> {
 | 
					    impl<'d, T: Instance, Dma: SdmmcDma<T>> BlockDevice for Sdmmc<'d, T, Dma> {
 | 
				
			||||||
        type Error = Error;
 | 
					        type Error = Error;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a
 | 
					        async fn read(
 | 
				
			||||||
        where
 | 
					            &mut self,
 | 
				
			||||||
            Self: 'a;
 | 
					            blocks: &mut [Block],
 | 
				
			||||||
 | 
					 | 
				
			||||||
        type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a
 | 
					 | 
				
			||||||
        where
 | 
					 | 
				
			||||||
            Self: 'a;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        fn read<'a>(
 | 
					 | 
				
			||||||
            &'a mut self,
 | 
					 | 
				
			||||||
            blocks: &'a mut [Block],
 | 
					 | 
				
			||||||
            start_block_idx: BlockIdx,
 | 
					            start_block_idx: BlockIdx,
 | 
				
			||||||
            _reason: &str,
 | 
					            _reason: &str,
 | 
				
			||||||
        ) -> Self::ReadFuture<'a> {
 | 
					        ) -> Result<(), Self::Error> {
 | 
				
			||||||
            async move {
 | 
					 | 
				
			||||||
            let mut address = start_block_idx.0;
 | 
					            let mut address = start_block_idx.0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for block in blocks.iter_mut() {
 | 
					            for block in blocks.iter_mut() {
 | 
				
			||||||
@@ -1687,10 +1676,8 @@ mod sdmmc_rs {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            Ok(())
 | 
					            Ok(())
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        fn write<'a>(&'a mut self, blocks: &'a [Block], start_block_idx: BlockIdx) -> Self::WriteFuture<'a> {
 | 
					        async fn write(&mut self, blocks: &[Block], start_block_idx: BlockIdx) -> Result<(), Self::Error> {
 | 
				
			||||||
            async move {
 | 
					 | 
				
			||||||
            let mut address = start_block_idx.0;
 | 
					            let mut address = start_block_idx.0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for block in blocks.iter() {
 | 
					            for block in blocks.iter() {
 | 
				
			||||||
@@ -1703,7 +1690,6 @@ mod sdmmc_rs {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            Ok(())
 | 
					            Ok(())
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        fn num_blocks(&self) -> Result<BlockCount, Self::Error> {
 | 
					        fn num_blocks(&self) -> Result<BlockCount, Self::Error> {
 | 
				
			||||||
            let card = self.card()?;
 | 
					            let card = self.card()?;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
 | 
				
			|||||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
 | 
					embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
 | 
				
			||||||
embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", "arch-cortex-m", "executor-thread", "executor-interrupt"] }
 | 
					embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", "arch-cortex-m", "executor-thread", "executor-interrupt"] }
 | 
				
			||||||
embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
 | 
					embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
 | 
				
			||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"]  }
 | 
					embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc"]  }
 | 
				
			||||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
 | 
					embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
 | 
				
			||||||
embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] }
 | 
					embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user