Skip to content

Commit 1f4c426

Browse files
authored
Remove ChipSelect default value in SpiConectionSettings (#59)
1 parent c83784c commit 1f4c426

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

System.Device.Spi/SpiConnectionSettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ private SpiConnectionSettings()
3838
/// Initializes a new instance of the <see cref="SpiConnectionSettings"/> class.
3939
/// </summary>
4040
/// <param name="busId">The bus ID the device is connected to.</param>
41-
/// <param name="chipSelectLine">The chip select line used on the bus. Optional, -1 if not used</param>
42-
public SpiConnectionSettings(int busId, int chipSelectLine = -1)
41+
/// <param name="chipSelectLine">The chip select line used on the bus. In .NET nanoFramework, you need to have a
42+
/// valid GPIO Chip Select even if you don't use it.</param>
43+
public SpiConnectionSettings(int busId, int chipSelectLine)
4344
{
4445
BusId = busId;
4546
ChipSelectLine = chipSelectLine;

Test/SpiHardwareUnitTests/SimpleSpiTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public void TryToSeeIfSpiIsSupported()
3636
public void CheckSpiConectionSettings()
3737
{
3838
// Arrange
39-
SpiConnectionSettings connectinSettings = new SpiConnectionSettings(1);
40-
connectinSettings.ChipSelectLine = 12;
39+
SpiConnectionSettings connectinSettings = new SpiConnectionSettings(1, 12);
4140
connectinSettings.ChipSelectLineActiveState = PinValue.High;
4241
connectinSettings.ClockFrequency = 1_000_000;
4342
connectinSettings.DataBitLength = 8;

0 commit comments

Comments
 (0)