From 0a3ed558c2ab5c3d1c96cab55e00e09f6f13d7b1 Mon Sep 17 00:00:00 2001 From: Rik Starmans Date: Thu, 30 May 2024 18:22:43 +0200 Subject: [PATCH] changed sleep to speed up flashing --- changelog.md | 3 +++ winbond/version.py | 2 +- winbond/winbond.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index a4c96a8..dc7a147 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed --> +## [0.5.4] - 2024-05-30 +### Fixed +- sleep changed to microsecond sleep to speed up flashing ## [0.5.3] - 2024-05-30 ### Fixed - fixed string formatting for compatibility with micropython diff --git a/winbond/version.py b/winbond/version.py index fdd3634..d5e09a4 100644 --- a/winbond/version.py +++ b/winbond/version.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 # -*- coding: UTF-8 -*- -__version_info__ = ("0", "5", "3") +__version_info__ = ("0", "5", "4") __version__ = ".".join(__version_info__) diff --git a/winbond/winbond.py b/winbond/winbond.py index 9710862..7c9f7bc 100644 --- a/winbond/winbond.py +++ b/winbond/winbond.py @@ -233,9 +233,9 @@ def _await(self) -> None: # last bit (1) is BUSY bit in stat. reg. byte (0 = not busy, 1 = busy) trials = 0 while 0x1 & self.spi.read(1, 0xFF)[0]: - if trials > 20: + if trials > 5E6: raise Exception("Device keeps busy, aborting.") - time.sleep(0.1) + time.sleep_us(1) trials += 1 self.cs(1) self._busy = False