Skip to content

Commit 474c077

Browse files
committed
Comms: exclude WinUSB on non-Windows
1 parent 5506e85 commit 474c077

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ExtLibs/Comms/MissionPlanner.Comms.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<Compile Remove="System.IO.Ports\**" />
2525
<EmbeddedResource Remove="System.IO.Ports\**" />
2626
<None Remove="System.IO.Ports\**" />
27+
<Compile Remove="CommsWinUSB.cs" Condition="'$(OS)' != 'Windows_NT'" />
2728
</ItemGroup>
2829

2930
<ItemGroup>
@@ -44,7 +45,7 @@
4445

4546
<ItemGroup>
4647
<ProjectReference Include="..\Interfaces\Interfaces.csproj" />
47-
<ProjectReference Include="..\WinUSBNet\Nefarius.Drivers.WinUSB.csproj" />
48+
<ProjectReference Include="..\WinUSBNet\Nefarius.Drivers.WinUSB.csproj" Condition="'$(OS)' == 'Windows_NT'" />
4849
</ItemGroup>
4950

5051
<ItemGroup>

MainV2.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,14 +3601,18 @@ protected override void OnLoad(EventArgs e)
36013601
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
36023602
MissionPlanner.Comms.CommsBLE.SerialPort_GetCustomPorts();
36033603

3604+
#if !LIB
36043605
MissionPlanner.Comms.CommsWinUSB.SerialPort_GetCustomPorts();
3606+
#endif
36053607
}
36063608
catch { }
36073609

36083610
// add the custom port creator
36093611
CustomPortList.Add(new Regex("BLE_.*"), (s1, s2) => { return new CommsBLE() { PortName = s1, BaudRate = int.Parse(s2) }; });
36103612

3613+
#if !LIB
36113614
CustomPortList.Add(new Regex("WINUSB_VID_.*"), (s1, s2) => { return new CommsWinUSB() { PortName = s1, BaudRate = int.Parse(s2) }; });
3615+
#endif
36123616

36133617
this.ResumeLayout();
36143618

0 commit comments

Comments
 (0)