Event splitting based on data content
Right now the events (in case where multiple are present in some data) are split based on the ES/NS bit and the decoding checks against that. It should be the other way around, so that the Decoder can report a finished event in the callback when the corresponding data has come. For RD53C this is the same, but for RD53B one would only know if an event has finished IF new data comes in or finalize is called.
If we are for example decoding scan data and expect 1600 events (RD53B), the current decoder would wait on the 1600th because it needs either finalize (which the scan code can't give since it might be actually missing) or new data (which won't arrive). This makes the mask stage time out, which takes too much time.