Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions FreePIE.Core.Plugins/ComDevicePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ private void ThreadAction()
serialPort.Open();
Init(serialPort);

/* try
{
serialPort.DiscardInBuffer();
}
catch (Exception e)
{
Console.WriteLine("Exception: " + e);
throw;
}
*/

while (true)
{
try
Expand Down
4 changes: 3 additions & 1 deletion FreePIE.Core.Plugins/GenericComPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public override string FriendlyName

protected override void Init(SerialPort serialPort)
{
//compiles but crashes
//serialPort.DiscardInBuffer();
}

protected override void Read(SerialPort serialPort)
Expand All @@ -50,7 +52,7 @@ public IEnumerable<byte[]> ReadExisting()
byte[] result;
if (buffers.TryDequeue(out result))
yield return result;

else
Thread.Yield();
}
}
Expand Down