public bool ReadData(ref byte[] TempData, uint Offset, uint Counter) { if (GetFIFOCounter() < Counter) { return(false); } if ((Offset + Counter) > TempData.Length) { return(false); } if ((ReadPointer + Counter) < BufferSize) { Array.Copy(Data, ReadPointer, TempData, Offset, Counter); ReadPointer += Counter; } else { uint Size1 = BufferSize - ReadPointer; uint Size2 = Counter - Size1; Array.Copy(Data, ReadPointer, TempData, Offset, Size1); Array.Copy(Data, 0, TempData, Offset + Size1, Size2); ReadPointer = Size2; } ReadCounter += Counter; if (UseEvents) { ReadExecuted.Set(); } return(true); }
public void AbortWait(bool SetAbort) { AbortWaitEvent = SetAbort; if (SetAbort) { WriteExecuted.Set(); ReadExecuted.Set(); } }