Commit 9f98885
committed
JP LBT: make busy-channel backoff non-blocking
isChannelActive() previously spin-waited (with YIELD_TASK()) for up to
16s after detecting RSSI busy, blocking Dispatcher::loop() from
servicing incoming packets for the duration of the backoff.
Replace the blocking wait with a state machine (_lbt_backoff_active /
_lbt_deadline): on busy detection, arm a deadline and return true
(busy) immediately. Dispatcher::checkSend()'s existing retry mechanism
(getCADFailRetryDelay()) re-polls isChannelActive() on the next
loop() pass; once the deadline has elapsed, re-sense (bounded,
single-level recursion) instead of assuming still-busy.
The initial 5ms RSSI sense and the post-clear jitter wait remain
blocking, as both are short (<=5ms and <=~1s respectively) relative
to the up-to-16s backoff this change targets.
Hardware-tested (LilyGo T3S3 sx1262 / Wio Tracker L1 Pro) in both quiet and
electrically noisy environments; confirmed both bidirectional and
unidirectional message delivery under legitimate busy-channel
conditions.1 parent 247b894 commit 9f98885
2 files changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
197 | 209 | | |
198 | 210 | | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 216 | + | |
| 217 | + | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
0 commit comments