Skip to content

Commit

Permalink
Merge pull request #1004 from WildernessLabs/jorge-add-ftxxxx-tests
Browse files Browse the repository at this point in the history
Apply same build fix from develop
  • Loading branch information
adrianstevens authored May 30, 2024
2 parents 3a11535 + 499e5b9 commit 5e4db38
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState =
/// <inheritdoc/>
public II2cBus CreateI2cBus(IPin[] pins, I2cBusSpeed busSpeed)
{
return CreateI2cBus(1);
return CreateI2cBus(1, I2cBusSpeed.Standard);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</PropertyGroup>

<ItemGroup>
<None Include=".\Readme.md" Pack="true" PackagePath="" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand All @@ -25,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Driver\ICs.IOExpanders.Ft232h.csproj" />
<ProjectReference Include="..\..\Driver\ICs.IOExpanders.Ftxxxx.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Ftd2xxTests
public void GetDeviceList()
{
// assumes an FT232 is connected
var devices = new FtdiDeviceCollection();
var devices = FtdiExpanderCollection.Devices;
devices.Refresh();
Assert.True(devices.Count > 0);
}
Expand All @@ -17,7 +17,7 @@ public void GetDeviceList()
public void OpenI2CBus()
{
// assumes an FT232 is connected
var ftdi = new Ft232h(false);
var ftdi = FtdiExpanderCollection.Devices[0];
var bus = ftdi.CreateI2cBus();
Assert.NotNull(bus);
}
Expand All @@ -26,7 +26,7 @@ public void OpenI2CBus()
public void OpenSPIBus()
{
// assumes an FT232 is connected
var ftdi = new Ft232h(false);
var ftdi = FtdiExpanderCollection.Devices[0];
var bus = ftdi.CreateSpiBus();
Assert.NotNull(bus);
}
Expand All @@ -35,7 +35,7 @@ public void OpenSPIBus()
public void NoDeviceForSpiCheck()
{
// assumes no FT232 is connected
var ftdi = new Ft232h(false);
var ftdi = FtdiExpanderCollection.Devices[0];
Assert.Throws<DeviceNotFoundException>(() =>
{
var bus = ftdi.CreateSpiBus();
Expand All @@ -46,7 +46,7 @@ public void NoDeviceForSpiCheck()
public void NoDeviceForI2CCheck()
{
// assumes no FT232 is connected
var ftdi = new Ft232h(false);
var ftdi = FtdiExpanderCollection.Devices[0];
Assert.Throws<DeviceNotFoundException>(() =>
{
var bus = ftdi.CreateI2cBus();
Expand All @@ -59,7 +59,7 @@ public void NoDriverCheck()
// assumes no FT232 driver is installed (rename C:\Windows\System32\ftd2xx.dll)
Assert.Throws<DriverNotInstalledException>(() =>
{
var ftdi = new Ft232h(false);
var ftdi = FtdiExpanderCollection.Devices[0];
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Atmospheric.Bmx280" Version="1.12.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Atmospheric.Bmx280" Version="1.12.0" />
</ItemGroup>
</Project>
11 changes: 10 additions & 1 deletion Source/Meadow.Foundation.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
Expand Down Expand Up @@ -1525,6 +1524,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aht10_Desktop_Sample", "Mea
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk_Image_Sample", "Meadow.Foundation.Peripherals\Displays.Silk\Samples\Silk_Image_Sample\Silk_Image_Sample.csproj", "{226E85FE-EB1A-46E9-B91A-50BC183F4BF3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5298E283-7653-42B2-8E01-9208DD1862C8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FT232.Unit.Tests", "Meadow.Foundation.Peripherals\ICs.IOExpanders.Ftxxxx\Tests\FT232.Unit.Tests\FT232.Unit.Tests.csproj", "{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3669,6 +3672,10 @@ Global
{226E85FE-EB1A-46E9-B91A-50BC183F4BF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{226E85FE-EB1A-46E9-B91A-50BC183F4BF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{226E85FE-EB1A-46E9-B91A-50BC183F4BF3}.Release|Any CPU.Build.0 = Release|Any CPU
{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -4431,6 +4438,8 @@ Global
{EA7B5437-D3CD-4996-9DB7-09E6DCB1D6EA} = {AE9AD583-1709-434D-9C7E-FE776B2005F0}
{C1AF868A-B1FF-4DE6-985B-07E2916A0325} = {AE9AD583-1709-434D-9C7E-FE776B2005F0}
{226E85FE-EB1A-46E9-B91A-50BC183F4BF3} = {3D090B0B-F863-4B8A-942C-89ED6C71BFF2}
{5298E283-7653-42B2-8E01-9208DD1862C8} = {4E0052C2-559D-4509-9C42-C6451B1F1FFC}
{1F457CEE-835E-4CD7-9AB5-6C5C2DA5449A} = {5298E283-7653-42B2-8E01-9208DD1862C8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AF7CA16F-8C38-4546-87A2-5DAAF58A1520}
Expand Down

0 comments on commit 5e4db38

Please sign in to comment.