aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2023-12-20 13:20:43 +0100
committerUlf Lilleengen <[email protected]>2023-12-20 13:25:36 +0100
commit1c3cf347cbd1b650f55a0c88a07210af83608157 (patch)
tree3584700bdf996f346cd468ad9cc6cda40a622f3e
parent52a801fdb7561c42a5036b30d4807e18580a845f (diff)
remove embedded-sdmmc
Remove support for embedded-sdmmc due to lack of maintainership. Bring it back once the upstream includes the async functionality.
-rwxr-xr-xci.sh4
-rw-r--r--embassy-stm32/Cargo.toml1
-rw-r--r--embassy-stm32/src/sdmmc/mod.rs50
-rw-r--r--examples/stm32f4/Cargo.toml2
4 files changed, 3 insertions, 54 deletions
diff --git a/ci.sh b/ci.sh
index 83c05d1b9..e3918783f 100755
--- a/ci.sh
+++ b/ci.sh
@@ -91,12 +91,12 @@ cargo batch \
91 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ 91 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \
92 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ 92 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \
93 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ 93 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \
94 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embedded-sdmmc,time \ 94 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \
95 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ 95 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \
96 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ 96 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \
97 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ 97 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \
98 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ 98 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \
99 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,embedded-sdmmc,time \ 99 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,time \
100 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ 100 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \
101 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ 101 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \
102 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ 102 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index 7f2cf6bfb..83db7c4bf 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -56,7 +56,6 @@ cortex-m = "0.7.6"
56futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 56futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
57rand_core = "0.6.3" 57rand_core = "0.6.3"
58sdio-host = "0.5.0" 58sdio-host = "0.5.0"
59embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true }
60critical-section = "1.1" 59critical-section = "1.1"
61stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2234f380f51d16d0398b8e547088b33ea623cc7c" } 60stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2234f380f51d16d0398b8e547088b33ea623cc7c" }
62vcell = "0.1.3" 61vcell = "0.1.3"
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs
index 10006baff..debe26c88 100644
--- a/embassy-stm32/src/sdmmc/mod.rs
+++ b/embassy-stm32/src/sdmmc/mod.rs
@@ -1538,53 +1538,3 @@ foreach_peripheral!(
1538 impl Instance for peripherals::$inst {} 1538 impl Instance for peripherals::$inst {}
1539 }; 1539 };
1540); 1540);
1541
1542#[cfg(feature = "embedded-sdmmc")]
1543mod sdmmc_rs {
1544 use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx};
1545
1546 use super::*;
1547
1548 impl<'d, T: Instance, Dma: SdmmcDma<T>> BlockDevice for Sdmmc<'d, T, Dma> {
1549 type Error = Error;
1550
1551 async fn read(
1552 &mut self,
1553 blocks: &mut [Block],
1554 start_block_idx: BlockIdx,
1555 _reason: &str,
1556 ) -> Result<(), Self::Error> {
1557 let mut address = start_block_idx.0;
1558
1559 for block in blocks.iter_mut() {
1560 let block: &mut [u8; 512] = &mut block.contents;
1561
1562 // NOTE(unsafe) Block uses align(4)
1563 let block = unsafe { &mut *(block as *mut _ as *mut DataBlock) };
1564 self.read_block(address, block).await?;
1565 address += 1;
1566 }
1567 Ok(())
1568 }
1569
1570 async fn write(&mut self, blocks: &[Block], start_block_idx: BlockIdx) -> Result<(), Self::Error> {
1571 let mut address = start_block_idx.0;
1572
1573 for block in blocks.iter() {
1574 let block: &[u8; 512] = &block.contents;
1575
1576 // NOTE(unsafe) DataBlock uses align 4
1577 let block = unsafe { &*(block as *const _ as *const DataBlock) };
1578 self.write_block(address, block).await?;
1579 address += 1;
1580 }
1581 Ok(())
1582 }
1583
1584 fn num_blocks(&self) -> Result<BlockCount, Self::Error> {
1585 let card = self.card()?;
1586 let count = card.csd.block_count();
1587 Ok(BlockCount(count))
1588 }
1589 }
1590}
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml
index 6ea0018cd..e24fbee82 100644
--- a/examples/stm32f4/Cargo.toml
+++ b/examples/stm32f4/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8# Change stm32f429zi to your chip name, if necessary. 8# Change stm32f429zi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "chrono"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }