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>
pull/804/head
Angus Gratton 2024-02-13 16:01:28 +11:00 zatwierdzone przez Damien George
rodzic b712103519
commit ad6ab5a78c
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -42,8 +42,8 @@ class SyncModem:
tx = True
while tx is True:
tx = self.poll_send()
self._sync_wait(will_irq)
tx = self.poll_send()
return tx
def recv(self, timeout_ms=None, rx_length=0xFF, rx_packet=None):

Wyświetl plik

@ -1,3 +1,3 @@
metadata(version="0.1.0")
metadata(version="0.1.1")
require("lora")
package("lora")