aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/i2c/v2.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs
index 4d341bab1..aeb4c1c00 100644
--- a/embassy-stm32/src/i2c/v2.rs
+++ b/embassy-stm32/src/i2c/v2.rs
@@ -408,6 +408,7 @@ impl<'d, M: Mode, IM: MasterMode> I2c<'d, M, IM> {
408 *byte = self.info.regs.rxdr().read().rxdata(); 408 *byte = self.info.regs.rxdr().read().rxdata();
409 } 409 }
410 } 410 }
411 self.wait_stop(timeout)?;
411 Ok(()) 412 Ok(())
412 } 413 }
413 414
@@ -463,11 +464,13 @@ impl<'d, M: Mode, IM: MasterMode> I2c<'d, M, IM> {
463 } 464 }
464 } 465 }
465 // Wait until the write finishes 466 // Wait until the write finishes
466 let result = self.wait_tc(timeout); 467 self.wait_tc(timeout)?;
467 if send_stop { 468 if send_stop {
468 self.master_stop(); 469 self.master_stop();
470 self.wait_stop(timeout)?;
469 } 471 }
470 result 472
473 Ok(())
471 } 474 }
472 475
473 // ========================= 476 // =========================