Skip to content

Try two times to clear the reset alert bit #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion adafruit_max1704x.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ def reset(self) -> None:
pass
else:
raise RuntimeError("Reset did not succeed")
self.reset_alert = False # clean up RI alert
for _ in range(2):
try:
self.reset_alert = False # clean up RI alert
return
except OSError:
# With CircuitPython 8.0.0-beta.6 and ESP32-S3, the first
# attempt to reset the alert fails.
continue
raise RuntimeError("Clearing reset alert did not succeed")

@property
def cell_voltage(self) -> float:
Expand Down