Skip to content

Commit

Permalink
Merge pull request #13 from hstarmans/slowfix
Browse files Browse the repository at this point in the history
fix extremely slow interaction issue #11
  • Loading branch information
brainelectronics authored May 30, 2024
2 parents f2641b5 + 0a3ed55 commit 43e025d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion winbond/version.py
Original file line number Diff line number Diff line change
@@ -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__)
4 changes: 2 additions & 2 deletions winbond/winbond.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43e025d

Please sign in to comment.