using System; using System.Collections.Concurrent; using System.Threading; using LoraGamepad.Models; namespace LoraGamepad.Util; public class CrsfParserPipeIn: IAsyncPipe { protected override void Process(ConcurrentQueue queue) { if (!queue.TryDequeue(out var data)) { SpinWait.SpinUntil(() => false, 1); return; } switch (data[0]) { case 0x16: OnOut(CrsfChMsg.FromBytes(data)); break; } } }