Skip to content

Commit 9f38aed

Browse files
committed
Add debug prints in read16
1 parent 0112c57 commit 9f38aed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,19 @@ uint16_t SFE_MAX1704X::read16(uint8_t address)
826826
else
827827
{
828828
retries--;
829+
if (_printDebug == true)
830+
{
831+
_debugPort->println(F("SFE_MAX1704X::read16: retrying..."));
832+
}
829833
delay(50);
830834
}
831835
}
832836

837+
if (_printDebug == true)
838+
{
839+
if (!success)
840+
_debugPort->println(F("SFE_MAX1704X::read16: failed to read data!"));
841+
}
842+
833843
return (result);
834844
}

0 commit comments

Comments
 (0)