k5prog icon indicating copy to clipboard operation
k5prog copied to clipboard

Drop timeout on sync.

Open wutje opened this issue 5 months ago • 1 comments

When out of sync all bytes must be drained at once in order to be able to reach sync again. This strategy works because the radio will repeatedly send the bootmessage. We do not need to save bytes and try to sync up based on bytes, just drop all received bytes and wait for the radio to send a new bootmessage.

If we wait 10 seconds (or any time longer then the boot message repeat time) we will read garbage from the previous package, discard those and the rest of the message and we will never reach sync.

wutje avatar Jul 21 '25 09:07 wutje

Ah after some more reading I think this also solves the problems in #22. My original implementation was like this but then commit 3eb6e144fcf8b4b4c3e44d06481e1032aeac894d changed the timeout from 0 to 10000. I did not notice until today because I just used my own compiled version and did not do a lot of development anyway. When I picked up this weekend I noticed this behavior

wutje avatar Jul 21 '25 19:07 wutje