From e01bb4b61407865268eb4e64f00a361aedba31c9 Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Mon, 17 Feb 2025 12:40:41 -0800 Subject: [PATCH] Remove Output.WriteLineIfs --- .../Meadow.F7/Hardware/Communications/SpiBus.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Source/implementations/f7/Meadow.F7/Hardware/Communications/SpiBus.cs b/Source/implementations/f7/Meadow.F7/Hardware/Communications/SpiBus.cs index bfabab556..65574763b 100644 --- a/Source/implementations/f7/Meadow.F7/Hardware/Communications/SpiBus.cs +++ b/Source/implementations/f7/Meadow.F7/Hardware/Communications/SpiBus.cs @@ -11,7 +11,6 @@ namespace Meadow.Hardware /// public partial class SpiBus : ISpiBus { - private bool _showSpiDebug = false; private SemaphoreSlim _busSemaphore = new SemaphoreSlim(1, 1); private SpiClockConfiguration? _clockConfig; @@ -187,7 +186,6 @@ public unsafe void Write( ChipSelectMode csMode = ChipSelectMode.ActiveLow) { _busSemaphore.Wait(); - Output.WriteLineIf(_showSpiDebug, $" +SendData"); try { @@ -207,13 +205,11 @@ public unsafe void Write( BusNumber = BusNumber }; - Output.WriteLineIf(_showSpiDebug, $" sending {writeBuffer.Length} bytes: {BitConverter.ToString(writeBuffer.ToArray())}"); var result = UPD.Ioctl(Nuttx.UpdIoctlFn.SPIData, ref command); if (result != 0) { DecipherSPIError(UPD.GetLastError()); } - Output.WriteLineIf(_showSpiDebug, $" send complete"); if (chipSelect != null) { @@ -225,7 +221,6 @@ public unsafe void Write( finally { _busSemaphore.Release(); - Output.WriteLineIf(_showSpiDebug, $" -SendData"); } } @@ -267,14 +262,11 @@ public unsafe void Exchange( BusNumber = BusNumber }; - Output.WriteLineIf(_showSpiDebug, "+Exchange"); - Output.WriteLineIf(_showSpiDebug, $" Sending {writeBuffer.Length} bytes"); var result = UPD.Ioctl(Nuttx.UpdIoctlFn.SPIData, ref command); if (result != 0) { DecipherSPIError(UPD.GetLastError()); } - Output.WriteLineIf(_showSpiDebug, $" Received {readBuffer.Length} bytes"); if (chipSelect != null) { @@ -319,7 +311,6 @@ private void SetBitsPerWord(int bitsPerWord) BitsPerWord = bitsPerWord }; - Output.WriteLineIf(_showSpiDebug, $" setting bus {command.BusNumber} bits per word to {command.BitsPerWord}"); var result = UPD.Ioctl(Nuttx.UpdIoctlFn.SPIBits, ref command); if (result != 0) { @@ -336,14 +327,11 @@ private void SetMode(int mode) Mode = mode }; - Output.WriteLineIf(_showSpiDebug, "+SetMode"); - Output.WriteLineIf(_showSpiDebug, $" setting bus {command.BusNumber} mode to {command.Mode}"); var result = UPD.Ioctl(Nuttx.UpdIoctlFn.SPIMode, ref command); if (result != 0) { DecipherSPIError(UPD.GetLastError()); } - Output.WriteLineIf(_showSpiDebug, $" mode set to {mode}"); } private Units.Frequency SetFrequency(Units.Frequency desiredSpeed) @@ -357,14 +345,11 @@ private Units.Frequency SetFrequency(Units.Frequency desiredSpeed) Frequency = Convert.ToInt64(speed.Hertz) }; - Output.WriteLineIf(_showSpiDebug, "+SetFrequency"); - Output.WriteLineIf(_showSpiDebug, $" setting bus {command.BusNumber} speed to {command.Frequency}"); var result = UPD.Ioctl(Nuttx.UpdIoctlFn.SPISpeed, ref command); if (result != 0) { DecipherSPIError(UPD.GetLastError()); } - Output.WriteLineIf(_showSpiDebug, $" speed set to {desiredSpeed}"); return speed; }