tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
599 stars 188 forks source link

mpu6050: return I2C error when configuring fails #473

Closed aykevl closed 1 year ago

aykevl commented 1 year ago

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.

There are a lot more drivers that could be fixed in a similar way. This commit doesn't do that yet, it just fixes the part that I can actually test.

Side note: I found that the code in TinyHCI will in fact always return a bus error while configuring. I don't know yet why. (EDIT: not always, but it will about half of the time).

deadprogram commented 1 year ago

Thanks @aykevl for this fix! Now merging.