From e94304a73abc4c08163ca9322be6231f64e5cac9 Mon Sep 17 00:00:00 2001 From: Josh Dersch Date: Mon, 2 Oct 2023 20:34:01 -0700 Subject: [PATCH] Small tweak to LED logic to ensure it's always in the proper state. --- PUP/Transport/3MbitAdapter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PUP/Transport/3MbitAdapter.cs b/PUP/Transport/3MbitAdapter.cs index f719250..cafe225 100644 --- a/PUP/Transport/3MbitAdapter.cs +++ b/PUP/Transport/3MbitAdapter.cs @@ -246,7 +246,6 @@ namespace IFS.Transport /// private void ReceiveFromNetworkInterface() { - _ledController.SetLed(3, 1); PruInterfaceControlBlock cb = GetInterfaceControlBlock(); if (cb.r_truncated != 0) @@ -280,6 +279,8 @@ namespace IFS.Transport return; } + _ledController.SetLed(3, 1); + // Grab the received data from the shared PRU memory: byte[] durationBuffer = new byte[receivedDataLength]; Marshal.Copy(new IntPtr(_sharedPruMemory.ToInt64() + R_PTR_OFFSET), durationBuffer, 0, receivedDataLength); @@ -291,6 +292,7 @@ namespace IFS.Transport if (decodedPacket == null) { Log.Write(LogType.Warning, LogComponent.E3Mbit, "Received bad packet."); + _ledController.SetLed(3, 0); return; }