mpu6050: return I2C error when configuring fails

An I2C bus can generate errors (like any I/O can), but they weren't
returned. This commit fixes this oversight.

Found while trying to figure out why LLVM 15 is broken just for the
itsybitsy-m4.
This commit is contained in:
Ayke van Laethem
2022-10-17 16:23:10 +02:00
committed by Ron Evans
parent c00cb3abdd
commit 42dc6eb068
+2 -2
View File
@@ -31,8 +31,8 @@ func (d Device) Connected() bool {
}
// Configure sets up the device for communication.
func (d Device) Configure() {
d.bus.WriteRegister(uint8(d.Address), PWR_MGMT_1, []uint8{0})
func (d Device) Configure() error {
return d.bus.WriteRegister(uint8(d.Address), PWR_MGMT_1, []uint8{0})
}
// ReadAcceleration reads the current acceleration from the device and returns