The ISR's only job is to queue it.into.the.buffer and exit, if enough frames can fill the queue before you finish pulling them the oldest, excess frames in the queue will be discarded. The background callback is if you want to handle the frame from within the ISR context, and not later via the queue. Running events() as fast as possible is your way to reading all the queues without having it fill to max and start discarding stale frames.
The fact that the ISR is so fast to clear the mailbox doesn't allow for overflow to next mailbox, is reason why only MB2 is picking up frames, as the first RX MB. You need to process events() as soon as possible to leave room for other frames to drop into the queue from the ISR. If you delay 500ms for events() and 20 frames come in, ISR puts them in queue, and you run events ONCE, theres 19 left to do. Delay again, 20 more frames, your up to 49,events() runs ONCE, your at 48 left. You need to process events as fast as possible, not let it wait on delayed code
Rezo thats fine, you can definately go faster if you want
The fact that the ISR is so fast to clear the mailbox doesn't allow for overflow to next mailbox, is reason why only MB2 is picking up frames, as the first RX MB. You need to process events() as soon as possible to leave room for other frames to drop into the queue from the ISR. If you delay 500ms for events() and 20 frames come in, ISR puts them in queue, and you run events ONCE, theres 19 left to do. Delay again, 20 more frames, your up to 49,events() runs ONCE, your at 48 left. You need to process events as fast as possible, not let it wait on delayed code
Rezo thats fine, you can definately go faster if you want
Last edited: