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 <[email protected]>
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

+1-1
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):
+1-1
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)