File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ int MagneticSensorI2C::read(uint8_t angle_reg_msb) {
95
95
// notify the device that is aboout to be read
96
96
wire->beginTransmission (chip_address);
97
97
wire->write (angle_reg_msb);
98
- wire->endTransmission (false );
98
+ currWireError = wire->endTransmission (false );
99
99
100
100
// read the data msb and lsb
101
101
wire->requestFrom (chip_address, (uint8_t )2 );
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ class MagneticSensorI2C: public Sensor{
51
51
/* * experimental function to check and fix SDA locked LOW issues */
52
52
int checkBus (byte sda_pin , byte scl_pin );
53
53
54
+ /* * current error code from Wire endTransmission() call **/
55
+ uint8_t currWireError = 0 ;
56
+
54
57
private:
55
58
float cpr; // !< Maximum range of the magnetic sensor
56
59
uint16_t lsb_used; // !< Number of bits used in LSB register
You can’t perform that action at this time.
0 commit comments