Skip to content

Commit ad6ab5a

Browse files
projectgusdpgeorge
authored andcommitted
lora-sync: Fix race with fast or failed send().
If send completes before the first call to poll_send(), the driver could get stuck in _sync_wait(). This had much less impact before rp2 port went tickless, as _sync_wait(will_irq=True) calls machine.idle() which may not wake very frequently on a tickless port. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent b712103 commit ad6ab5a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

micropython/lora/lora-sync/lora/sync_modem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def send(self, packet, tx_at_ms=None):
4242

4343
tx = True
4444
while tx is True:
45-
tx = self.poll_send()
4645
self._sync_wait(will_irq)
46+
tx = self.poll_send()
4747
return tx
4848

4949
def recv(self, timeout_ms=None, rx_length=0xFF, rx_packet=None):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.1.0")
1+
metadata(version="0.1.1")
22
require("lora")
33
package("lora")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy