From 9231943cbca88e487e44beb9e1f9b87e1ac7003e Mon Sep 17 00:00:00 2001 From: BiffoBear Date: Thu, 27 Apr 2023 03:30:38 +0300 Subject: [PATCH] Future proofed w5500 initialisation. --- adafruit_wiznet5k/adafruit_wiznet5k.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k.py b/adafruit_wiznet5k/adafruit_wiznet5k.py index fb5c393..49b07b9 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k.py @@ -477,8 +477,9 @@ def _detect_and_reset_w5500() -> bool: """ self._chip_type = "w5500" self._write_mr(0x80) - while self._read_mr()[0] & 0x80: - pass + time.sleep(0.05) + if self._read_mr()[0] & 0x80: + return False # assert self.sw_reset() == 0, "Chip not reset properly!" self._write_mr(0x08)