aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-06-22 21:04:22 +0000
committerGitHub <[email protected]>2025-06-22 21:04:22 +0000
commitc9709cf19dcf42a1dc33befaa8d7816634586d8c (patch)
tree0d37a67922b77abec058bea6c3617e9889f58ba3 /embassy-stm32
parentf7f5fe11208f4a7f1b58c8161b8e5307c90dfb80 (diff)
parente155d17328b3015a38734df3b540ac0881b05d1c (diff)
Merge pull request #4311 from antonok-edm/sdmmc-set-datatime-during-init
[sdmmc] Set `datatime` during initialization
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/sdmmc/mod.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs
index 6a02aae70..675d1813b 100644
--- a/embassy-stm32/src/sdmmc/mod.rs
+++ b/embassy-stm32/src/sdmmc/mod.rs
@@ -751,7 +751,6 @@ impl<'d, T: Instance> Sdmmc<'d, T> {
751 Self::wait_idle(); 751 Self::wait_idle();
752 Self::clear_interrupt_flags(); 752 Self::clear_interrupt_flags();
753 753
754 regs.dtimer().write(|w| w.set_datatime(config.data_transfer_timeout));
755 regs.dlenr().write(|w| w.set_datalength(length_bytes)); 754 regs.dlenr().write(|w| w.set_datalength(length_bytes));
756 755
757 #[cfg(sdmmc_v1)] 756 #[cfg(sdmmc_v1)]
@@ -789,8 +788,6 @@ impl<'d, T: Instance> Sdmmc<'d, T> {
789 Self::wait_idle(); 788 Self::wait_idle();
790 Self::clear_interrupt_flags(); 789 Self::clear_interrupt_flags();
791 790
792 regs.dtimer()
793 .write(|w| w.set_datatime(self.config.data_transfer_timeout));
794 regs.dlenr().write(|w| w.set_datalength(length_bytes)); 791 regs.dlenr().write(|w| w.set_datalength(length_bytes));
795 792
796 #[cfg(sdmmc_v1)] 793 #[cfg(sdmmc_v1)]
@@ -1349,6 +1346,8 @@ impl<'d, T: Instance> Sdmmc<'d, T> {
1349 #[cfg(sdmmc_v1)] 1346 #[cfg(sdmmc_v1)]
1350 w.set_bypass(_bypass); 1347 w.set_bypass(_bypass);
1351 }); 1348 });
1349 regs.dtimer()
1350 .write(|w| w.set_datatime(self.config.data_transfer_timeout));
1352 1351
1353 regs.power().modify(|w| w.set_pwrctrl(PowerCtrl::On as u8)); 1352 regs.power().modify(|w| w.set_pwrctrl(PowerCtrl::On as u8));
1354 Self::cmd(common_cmd::idle(), false)?; 1353 Self::cmd(common_cmd::idle(), false)?;