Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checking address on I2C transaction start/end #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
Loading