Skip to content

Commit 8cf5110

Browse files
committed
Simplify I2c bus selection
1 parent ce452c2 commit 8cf5110

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

Diff for: src/i2c.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -233,19 +233,10 @@ impl I2c {
233233
match DeviceInfo::new()?.model() {
234234
// Pi B Rev 1 uses I2C0
235235
Model::RaspberryPiBRev1 => I2c::with_bus(0),
236-
Model::RaspberryPi4B
237-
| Model::RaspberryPi400
238-
| Model::RaspberryPiComputeModule4
239-
| Model::RaspberryPiComputeModule4S
240-
| Model::RaspberryPi5
241-
| Model::RaspberryPi500
242-
| Model::RaspberryPiComputeModule5
243-
| Model::RaspberryPiComputeModule5Lite => {
244-
// Pi 4B/400 could have I2C3 enabled on pins 3 and 5
236+
_ => {
237+
// Pi 4B or later could have I2C3 enabled on pins 3 and 5
245238
I2c::with_bus(1).or_else(|_| I2c::with_bus(3))
246239
}
247-
// Everything else should be using I2C1
248-
_ => I2c::with_bus(1),
249240
}
250241
}
251242

0 commit comments

Comments
 (0)