From cee4b94cd75c6398962af3df3dee7086015b1889 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Wed, 29 May 2024 17:21:57 -0700 Subject: [PATCH 1/2] Apply same build fix from develop --- .../ICs.IOExpanders.Ftxxxx/Driver/FtdiExpander.cs | 2 +- .../Tests/FT232.Unit.Tests/FT232.Unit.Tests.csproj | 3 +-- .../FT232.Unit.Tests/{UnitTest1.cs => Ftd2xx.cs} | 12 ++++++------ Source/Meadow.Foundation.sln | 11 ++++++++++- 4 files changed, 18 insertions(+), 10 deletions(-) rename Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/{UnitTest1.cs => Ftd2xx.cs} (79%) diff --git a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Driver/FtdiExpander.cs b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Driver/FtdiExpander.cs index 5b2b30252c..d9d25119fb 100644 --- a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Driver/FtdiExpander.cs +++ b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Driver/FtdiExpander.cs @@ -280,7 +280,7 @@ public IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState = /// public II2cBus CreateI2cBus(IPin[] pins, I2cBusSpeed busSpeed) { - return CreateI2cBus(1); + return CreateI2cBus(1, I2cBusSpeed.Standard); } /// diff --git a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/FT232.Unit.Tests.csproj b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/FT232.Unit.Tests.csproj index f88a07f68e..15c4c25aac 100644 --- a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/FT232.Unit.Tests.csproj +++ b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/FT232.Unit.Tests.csproj @@ -11,7 +11,6 @@ - @@ -25,7 +24,7 @@ - + diff --git a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/UnitTest1.cs b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/Ftd2xx.cs similarity index 79% rename from Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/UnitTest1.cs rename to Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/Ftd2xx.cs index acf2f26d54..c63289191c 100644 --- a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/UnitTest1.cs +++ b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Ftxxxx/Tests/FT232.Unit.Tests/Ftd2xx.cs @@ -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); } @@ -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); } @@ -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); } @@ -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(() => { var bus = ftdi.CreateSpiBus(); @@ -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(() => { var bus = ftdi.CreateI2cBus(); @@ -59,7 +59,7 @@ public void NoDriverCheck() // assumes no FT232 driver is installed (rename C:\Windows\System32\ftd2xx.dll) Assert.Throws(() => { - var ftdi = new Ft232h(false); + var ftdi = FtdiExpanderCollection.Devices[0]; }); } } \ No newline at end of file diff --git a/Source/Meadow.Foundation.sln b/Source/Meadow.Foundation.sln index 11d6dd0ff0..5a27ea27aa 100644 --- a/Source/Meadow.Foundation.sln +++ b/Source/Meadow.Foundation.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32901.215 @@ -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 @@ -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 @@ -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} From ef568601cb4751b68b82b2104b7648ca4bbc3fb8 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Wed, 29 May 2024 17:25:10 -0700 Subject: [PATCH 2/2] Build fix fot VB.NET sample --- .../Samples/Bme280_VB_Sample/Bme280_VB_Sample.vbproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Meadow.Foundation.Peripherals/Sensors.Atmospheric.Bmx280/Samples/Bme280_VB_Sample/Bme280_VB_Sample.vbproj b/Source/Meadow.Foundation.Peripherals/Sensors.Atmospheric.Bmx280/Samples/Bme280_VB_Sample/Bme280_VB_Sample.vbproj index 36bb4ef9dd..047eefa4f0 100644 --- a/Source/Meadow.Foundation.Peripherals/Sensors.Atmospheric.Bmx280/Samples/Bme280_VB_Sample/Bme280_VB_Sample.vbproj +++ b/Source/Meadow.Foundation.Peripherals/Sensors.Atmospheric.Bmx280/Samples/Bme280_VB_Sample/Bme280_VB_Sample.vbproj @@ -6,7 +6,7 @@ App - - + +