Skip to content

Commit

Permalink
Final fixes needed for minimal 2018 install
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Jan 10, 2018
1 parent 41d3483 commit 77612c8
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 15 deletions.
3 changes: 2 additions & 1 deletion HAL/Delegates/HALDriverStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void Ping()
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void HAL_ObserveUserProgramTestDelegate();
[NativeDelegate] public static HAL_ObserveUserProgramTestDelegate HAL_ObserveUserProgramTest;


/*
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int NativeHALSetErrorDataDelegate(byte[] errors, int errorsLength, int waitMs);
[NativeDelegate("HAL_SetErrorData")]
Expand All @@ -109,6 +109,7 @@ public static int HAL_SetErrorData(string errors, int waitMs)
byte[] errorB = HAL.CreateUTF8String(errors, out len);
return NativeHALSetErrorData(errorB, len, waitMs);
}
*/
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int NativeHALSendErrorDelegate(int isError, int errorCode, int isLVCode,
byte[] details, byte[] location, byte[] callStack, int printMsg);
Expand Down
3 changes: 2 additions & 1 deletion HAL/Delegates/HALSPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void Ping()

[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void HAL_SetSPIHandleDelegate(int port, int handle);
[NativeDelegate] public static HAL_SetSPIHandleDelegate HAL_SetSPIHandle;

/*
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void HAL_InitSPIAccumulatorDelegate(int port, int period, int cmd, int xfer_size, int valid_mask, int valid_value, int data_shift, int data_size, [MarshalAs(UnmanagedType.Bool)]bool is_signed, [MarshalAs(UnmanagedType.Bool)]bool big_endian, ref int status);
[NativeDelegate] public static HAL_InitSPIAccumulatorDelegate HAL_InitSPIAccumulator;
Expand Down Expand Up @@ -80,6 +80,7 @@ public static void Ping()
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void HAL_GetSPIAccumulatorOutputDelegate(int port, ref long value, ref long count, ref int status);
[NativeDelegate] public static HAL_GetSPIAccumulatorOutputDelegate HAL_GetSPIAccumulatorOutput;
*/
}
}

2 changes: 1 addition & 1 deletion HAL/Delegates/LibraryLoaderHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static LibraryLoaderHolder()
resourceRoot + "x86.mockhal.dll");
s_nativeLoader.AddLibraryLocation(OsType.Windows64,
resourceRoot + "amd64.mockhal.dll");
s_nativeLoader.AddLibraryLocation(OsType.roboRIO, "libHALAthena.so");
s_nativeLoader.AddLibraryLocation(OsType.roboRIO, "libwpiHal.so");
/*
NativeLoader.AddLibraryLocation(OsType.Linux32,
resourceRoot + "x86.libcscore.so");
Expand Down
17 changes: 17 additions & 0 deletions LoadTester/LoadTester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,38 @@
<None Include="wpinative\libntcore.so" />
<None Include="wpinative\libOpenCvSharpExtern.so" />
<None Include="wpinative\libopencv_calib3d.so.3.1" />
<None Include="wpinative\libopencv_calib3d.so.3.2" />
<None Include="wpinative\libopencv_core.so.3.1" />
<None Include="wpinative\libopencv_core.so.3.2" />
<None Include="wpinative\libopencv_features2d.so.3.1" />
<None Include="wpinative\libopencv_features2d.so.3.2" />
<None Include="wpinative\libopencv_flann.so.3.1" />
<None Include="wpinative\libopencv_flann.so.3.2" />
<None Include="wpinative\libopencv_highgui.so.3.1" />
<None Include="wpinative\libopencv_highgui.so.3.2" />
<None Include="wpinative\libopencv_imgcodecs.so.3.1" />
<None Include="wpinative\libopencv_imgcodecs.so.3.2" />
<None Include="wpinative\libopencv_imgproc.so.3.1" />
<None Include="wpinative\libopencv_imgproc.so.3.2" />
<None Include="wpinative\libopencv_ml.so.3.1" />
<None Include="wpinative\libopencv_ml.so.3.2" />
<None Include="wpinative\libopencv_objdetect.so.3.1" />
<None Include="wpinative\libopencv_objdetect.so.3.2" />
<None Include="wpinative\libopencv_photo.so.3.1" />
<None Include="wpinative\libopencv_photo.so.3.2" />
<None Include="wpinative\libopencv_shape.so.3.1" />
<None Include="wpinative\libopencv_shape.so.3.2" />
<None Include="wpinative\libopencv_stitching.so.3.1" />
<None Include="wpinative\libopencv_stitching.so.3.2" />
<None Include="wpinative\libopencv_superres.so.3.1" />
<None Include="wpinative\libopencv_superres.so.3.2" />
<None Include="wpinative\libopencv_video.so.3.1" />
<None Include="wpinative\libopencv_video.so.3.2" />
<None Include="wpinative\libopencv_videoio.so.3.1" />
<None Include="wpinative\libopencv_videoio.so.3.2" />
<None Include="wpinative\libopencv_videostab.so.3.1" />
<None Include="wpinative\libopencv_videostab.so.3.2" />
<None Include="wpinative\libwpiHal.so" />
<None Include="wpinative\libwpiutil.so" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion LoadTester/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="FRC.NetworkTables" version="3.1.8" targetFramework="net461" />
<package id="FRC.OpenCvSharp" version="1.0.3" targetFramework="net461" />
<package id="FRC.OpenCvSharp.DesktopLibraries" version="1.0.3" targetFramework="net461" />
<package id="FRC.WPILibNativeLibraries" version="2017.1.0" targetFramework="net461" />
<package id="FRC.WPILibNativeLibraries" version="2018.1.0" targetFramework="net461" />
<package id="NativeLibraryUtilities" version="1.0.3" targetFramework="net461" />
<package id="Nito.AsyncEx.Context" version="1.1.0" targetFramework="net461" />
<package id="Nito.AsyncEx.Coordination" version="1.0.2" targetFramework="net461" />
Expand Down
17 changes: 17 additions & 0 deletions WPILib.IntegrationTests/WPILib.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,38 @@
<None Include="wpinative\libntcore.so" />
<None Include="wpinative\libOpenCvSharpExtern.so" />
<None Include="wpinative\libopencv_calib3d.so.3.1" />
<None Include="wpinative\libopencv_calib3d.so.3.2" />
<None Include="wpinative\libopencv_core.so.3.1" />
<None Include="wpinative\libopencv_core.so.3.2" />
<None Include="wpinative\libopencv_features2d.so.3.1" />
<None Include="wpinative\libopencv_features2d.so.3.2" />
<None Include="wpinative\libopencv_flann.so.3.1" />
<None Include="wpinative\libopencv_flann.so.3.2" />
<None Include="wpinative\libopencv_highgui.so.3.1" />
<None Include="wpinative\libopencv_highgui.so.3.2" />
<None Include="wpinative\libopencv_imgcodecs.so.3.1" />
<None Include="wpinative\libopencv_imgcodecs.so.3.2" />
<None Include="wpinative\libopencv_imgproc.so.3.1" />
<None Include="wpinative\libopencv_imgproc.so.3.2" />
<None Include="wpinative\libopencv_ml.so.3.1" />
<None Include="wpinative\libopencv_ml.so.3.2" />
<None Include="wpinative\libopencv_objdetect.so.3.1" />
<None Include="wpinative\libopencv_objdetect.so.3.2" />
<None Include="wpinative\libopencv_photo.so.3.1" />
<None Include="wpinative\libopencv_photo.so.3.2" />
<None Include="wpinative\libopencv_shape.so.3.1" />
<None Include="wpinative\libopencv_shape.so.3.2" />
<None Include="wpinative\libopencv_stitching.so.3.1" />
<None Include="wpinative\libopencv_stitching.so.3.2" />
<None Include="wpinative\libopencv_superres.so.3.1" />
<None Include="wpinative\libopencv_superres.so.3.2" />
<None Include="wpinative\libopencv_video.so.3.1" />
<None Include="wpinative\libopencv_video.so.3.2" />
<None Include="wpinative\libopencv_videoio.so.3.1" />
<None Include="wpinative\libopencv_videoio.so.3.2" />
<None Include="wpinative\libopencv_videostab.so.3.1" />
<None Include="wpinative\libopencv_videostab.so.3.2" />
<None Include="wpinative\libwpiHal.so" />
<None Include="wpinative\libwpiutil.so" />
</ItemGroup>
<Choose>
Expand Down
2 changes: 1 addition & 1 deletion WPILib.IntegrationTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="FRC.NetworkTables" version="3.1.8" targetFramework="net461" />
<package id="FRC.OpenCvSharp" version="1.0.3" targetFramework="net451" />
<package id="FRC.OpenCvSharp.DesktopLibraries" version="1.0.3" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2017.1.0" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2018.1.0" targetFramework="net461" />
<package id="NativeLibraryUtilities" version="1.0.3" targetFramework="net451" />
<package id="Nito.AsyncEx.Context" version="1.1.0" targetFramework="net461" />
<package id="Nito.AsyncEx.Coordination" version="1.0.2" targetFramework="net461" />
Expand Down
7 changes: 2 additions & 5 deletions WPILib.Tests/TestNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,19 @@ public void TestSingle()
public void TestSingleWithObject()
{
int count = 0;
object obj = null;
Action<object> mockDelegate = o =>
Action mockDelegate = () =>
{
count++;
obj = o;
};

using (Notifier nt = new Notifier(mockDelegate, this))
using (Notifier nt = new Notifier(mockDelegate))
{
nt.StartSingle(0.25);

Thread.Sleep(500);
}

Assert.AreEqual(1, count);
Assert.AreEqual(this, obj);
}
/*
[Test]
Expand Down
17 changes: 17 additions & 0 deletions WPILib.Tests/WPILib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,21 +209,38 @@
<None Include="wpinative\libntcore.so" />
<None Include="wpinative\libOpenCvSharpExtern.so" />
<None Include="wpinative\libopencv_calib3d.so.3.1" />
<None Include="wpinative\libopencv_calib3d.so.3.2" />
<None Include="wpinative\libopencv_core.so.3.1" />
<None Include="wpinative\libopencv_core.so.3.2" />
<None Include="wpinative\libopencv_features2d.so.3.1" />
<None Include="wpinative\libopencv_features2d.so.3.2" />
<None Include="wpinative\libopencv_flann.so.3.1" />
<None Include="wpinative\libopencv_flann.so.3.2" />
<None Include="wpinative\libopencv_highgui.so.3.1" />
<None Include="wpinative\libopencv_highgui.so.3.2" />
<None Include="wpinative\libopencv_imgcodecs.so.3.1" />
<None Include="wpinative\libopencv_imgcodecs.so.3.2" />
<None Include="wpinative\libopencv_imgproc.so.3.1" />
<None Include="wpinative\libopencv_imgproc.so.3.2" />
<None Include="wpinative\libopencv_ml.so.3.1" />
<None Include="wpinative\libopencv_ml.so.3.2" />
<None Include="wpinative\libopencv_objdetect.so.3.1" />
<None Include="wpinative\libopencv_objdetect.so.3.2" />
<None Include="wpinative\libopencv_photo.so.3.1" />
<None Include="wpinative\libopencv_photo.so.3.2" />
<None Include="wpinative\libopencv_shape.so.3.1" />
<None Include="wpinative\libopencv_shape.so.3.2" />
<None Include="wpinative\libopencv_stitching.so.3.1" />
<None Include="wpinative\libopencv_stitching.so.3.2" />
<None Include="wpinative\libopencv_superres.so.3.1" />
<None Include="wpinative\libopencv_superres.so.3.2" />
<None Include="wpinative\libopencv_video.so.3.1" />
<None Include="wpinative\libopencv_video.so.3.2" />
<None Include="wpinative\libopencv_videoio.so.3.1" />
<None Include="wpinative\libopencv_videoio.so.3.2" />
<None Include="wpinative\libopencv_videostab.so.3.1" />
<None Include="wpinative\libopencv_videostab.so.3.2" />
<None Include="wpinative\libwpiHal.so" />
<None Include="wpinative\libwpiutil.so" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion WPILib.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="FRC.NetworkTables" version="3.1.8" targetFramework="net461" />
<package id="FRC.OpenCvSharp" version="1.0.3" targetFramework="net451" />
<package id="FRC.OpenCvSharp.DesktopLibraries" version="1.0.3" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2017.1.0" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2018.1.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net451" />
<package id="Microsoft.CodeAnalysis.Common" version="1.3.2" targetFramework="net451" />
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.2" targetFramework="net451" />
Expand Down
4 changes: 3 additions & 1 deletion WPILib/ADXRS450_Gyro.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
/*
using System;
using HAL.Base;
using WPILib.Interfaces;
using WPILib.LiveWindow;
Expand Down Expand Up @@ -179,3 +180,4 @@ public override double GetRate()
}
}
}
*/
4 changes: 3 additions & 1 deletion WPILib/Notifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ public void StartPeriodic(double period)

public void Stop()
{
HAL_CancelNotifierAlarm(Interlocked.Add(ref m_notifier, 0));
int status = 0;
HAL_CancelNotifierAlarm(Interlocked.Add(ref m_notifier, 0), ref status);

}
}
}
3 changes: 2 additions & 1 deletion WPILib/SPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public int Transaction(byte[] dataToSend, byte[] dataReceived, int size)
Array.Copy(receivedBuffer, dataReceived, Math.Min(receivedBuffer.Length, dataReceived.Length));
return retVal;
}

/*
/// <summary>
/// Initialize the accumulator.
/// </summary>
Expand Down Expand Up @@ -329,5 +329,6 @@ public void GetAccumulatorOutput(ref long value, ref long count)
HAL_GetSPIAccumulatorOutput((byte)m_port, ref value, ref count, ref status);
CheckStatus(status);
}
*/
}
}
17 changes: 17 additions & 0 deletions WPILib/WPILib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,38 @@
<None Include="wpinative\libntcore.so" />
<None Include="wpinative\libOpenCvSharpExtern.so" />
<None Include="wpinative\libopencv_calib3d.so.3.1" />
<None Include="wpinative\libopencv_calib3d.so.3.2" />
<None Include="wpinative\libopencv_core.so.3.1" />
<None Include="wpinative\libopencv_core.so.3.2" />
<None Include="wpinative\libopencv_features2d.so.3.1" />
<None Include="wpinative\libopencv_features2d.so.3.2" />
<None Include="wpinative\libopencv_flann.so.3.1" />
<None Include="wpinative\libopencv_flann.so.3.2" />
<None Include="wpinative\libopencv_highgui.so.3.1" />
<None Include="wpinative\libopencv_highgui.so.3.2" />
<None Include="wpinative\libopencv_imgcodecs.so.3.1" />
<None Include="wpinative\libopencv_imgcodecs.so.3.2" />
<None Include="wpinative\libopencv_imgproc.so.3.1" />
<None Include="wpinative\libopencv_imgproc.so.3.2" />
<None Include="wpinative\libopencv_ml.so.3.1" />
<None Include="wpinative\libopencv_ml.so.3.2" />
<None Include="wpinative\libopencv_objdetect.so.3.1" />
<None Include="wpinative\libopencv_objdetect.so.3.2" />
<None Include="wpinative\libopencv_photo.so.3.1" />
<None Include="wpinative\libopencv_photo.so.3.2" />
<None Include="wpinative\libopencv_shape.so.3.1" />
<None Include="wpinative\libopencv_shape.so.3.2" />
<None Include="wpinative\libopencv_stitching.so.3.1" />
<None Include="wpinative\libopencv_stitching.so.3.2" />
<None Include="wpinative\libopencv_superres.so.3.1" />
<None Include="wpinative\libopencv_superres.so.3.2" />
<None Include="wpinative\libopencv_video.so.3.1" />
<None Include="wpinative\libopencv_video.so.3.2" />
<None Include="wpinative\libopencv_videoio.so.3.1" />
<None Include="wpinative\libopencv_videoio.so.3.2" />
<None Include="wpinative\libopencv_videostab.so.3.1" />
<None Include="wpinative\libopencv_videostab.so.3.2" />
<None Include="wpinative\libwpiHal.so" />
<None Include="wpinative\libwpiutil.so" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion WPILib/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="FRC.CameraServer" version="1.0.2" targetFramework="net451" />
<package id="FRC.NetworkTables" version="3.1.8" targetFramework="net461" />
<package id="FRC.OpenCvSharp" version="1.0.3" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2017.1.0" targetFramework="net451" />
<package id="FRC.WPILibNativeLibraries" version="2018.1.0" targetFramework="net461" />
<package id="NativeLibraryUtilities" version="1.0.3" targetFramework="net451" />
<package id="Nito.AsyncEx.Context" version="1.1.0" targetFramework="net461" />
<package id="Nito.AsyncEx.Coordination" version="1.0.2" targetFramework="net461" />
Expand Down

0 comments on commit 77612c8

Please sign in to comment.