Skip to content

Commit 5bec55c

Browse files
authored
Merge pull request #10 from adafruit/retry-reset-esp32s3
Try two times to clear the reset alert bit
2 parents 74c724d + c4944a7 commit 5bec55c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

adafruit_max1704x.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,15 @@ def reset(self) -> None:
124124
pass
125125
else:
126126
raise RuntimeError("Reset did not succeed")
127-
self.reset_alert = False # clean up RI alert
127+
for _ in range(2):
128+
try:
129+
self.reset_alert = False # clean up RI alert
130+
return
131+
except OSError:
132+
# With CircuitPython 8.0.0-beta.6 and ESP32-S3, the first
133+
# attempt to reset the alert fails.
134+
continue
135+
raise RuntimeError("Clearing reset alert did not succeed")
128136

129137
@property
130138
def cell_voltage(self) -> float:

0 commit comments

Comments
 (0)