diff --git a/src/devices/Display/Large4Digit7SegmentDisplay.cs b/src/devices/Display/Large4Digit7SegmentDisplay.cs index d67e59bb4f..7505ef9bf3 100644 --- a/src/devices/Display/Large4Digit7SegmentDisplay.cs +++ b/src/devices/Display/Large4Digit7SegmentDisplay.cs @@ -253,7 +253,9 @@ public void Write(string value, Alignment alignment = Alignment.Left) value = " " + value[0] + value.Substring(2, 2); break; case 5 when value[2] != ':': - throw new ArgumentException($"{nameof(value)}[2] must be a ':'", nameof(value)); +#pragma warning disable CA2208 // False positive because the message uses the parameter name "value" + throw new ArgumentException("value[2] must be a ':'", nameof(value)); +#pragma warning restore CA2208 case 5: Dots |= Dot.CenterColon; value = value.Substring(0, 2) + value.Substring(3, 2); diff --git a/src/devices/ShiftRegister/ShiftRegister.cs b/src/devices/ShiftRegister/ShiftRegister.cs index 8657f81636..1225bcd1da 100644 --- a/src/devices/ShiftRegister/ShiftRegister.cs +++ b/src/devices/ShiftRegister/ShiftRegister.cs @@ -120,7 +120,7 @@ public void ShiftBit(PinValue value) { if (_controller is null || _pinMapping.SerialDataInput < 0) { - throw new ArgumentNullException(nameof(ShiftBit), "GpioController was not provided or {nameof(_pinMapping.SerialDataInput)} not mapped to pin"); + throw new ArgumentNullException(nameof(value), "GpioController was not provided or {nameof(_pinMapping.SerialDataInput)} not mapped to pin"); } // writes value to serial data pin