Open MabezDev opened 1 year ago
Alternatively, we could rely on rxfifo_full_thrhd to raise an interrupt only when some moderately large number of bytes (e.g. 100 bytes) are in the FIFO? That would still gave enough time for the interrupt handler to copy those bytes out of the FIFO before an overflow happens.
Yeah, I think that would work better actually, because our slip packets are quite small.
@igrr How would this work when the packet exchange ends and there are say 90 bytes left in the FIFO?
The simplest option is probably to enable the RX timeout interrupt. It will fire if no byte has been received for a given number of cycles.
Currently, the uart is being interrupted on every byte this is not optimal for performance, and especially at higher bauds we make miss single bytes. We should use the AT-CMD feature to detect end the end of slip packets and fetch a packet at a time in the interrupt.