Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Check address in I2C transaction start/end operations. (#121)

### Changed


Expand Down
8 changes: 8 additions & 0 deletions src/eh1/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ impl I2c for Mock {
Mode::TransactionStart,
"i2c::transaction_start unexpected mode"
);
assert_eq!(
w.expected_addr, address,
"i2c::transaction_start address mismatch"
);

for op in operations {
match op {
Expand All @@ -282,6 +286,10 @@ impl I2c for Mock {
Mode::TransactionEnd,
"i2c::transaction_end unexpected mode"
);
assert_eq!(
w.expected_addr, address,
"i2c::transaction_end address mismatch"
);

Ok(())
}
Expand Down