Skip to content

Commit 142e46e

Browse files
authored
Update adafruit_max1704x.py
I was getting the exception "Clearing reset alert did not succeed" when trying to initialize the MAX17048 battery monitor on the ESP32-S3 (no psram) board. I'm running with CircuitPython 8.0.4 and the 8.x Library Bundles built on 3/27/2023. The line of code giving the error was `monitor = adafruit_max1704x.MAX17048(board.I2C())` By changing the loop to run 3 times fixed the issue for me, and I see the comment saying on this board it fails to reset the first time. Like my old mentor used to say, if twice is good three times is better :)
1 parent 2812e5a commit 142e46e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_max1704x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def reset(self) -> None:
124124
pass
125125
else:
126126
raise RuntimeError("Reset did not succeed")
127-
for _ in range(2):
127+
for _ in range(3):
128128
try:
129129
self.reset_alert = False # clean up RI alert
130130
return

0 commit comments

Comments
 (0)