Skip to content

Commit

Permalink
Testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
maniglia committed Oct 19, 2023
1 parent e7ca229 commit e6feb28
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/01/KSociety.SharpCubeProgrammer/CubeProgrammerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ public CubeProgrammerApi(IWmiManager wmiManager, ILogger<CubeProgrammerApi>? log

if (Environment.Is64BitProcess)
{
Assembly.LoadFrom(@".\dll\x64\STLinkUSBDriver.dll");
//Assembly.Load(@".\dll\x64\STLinkUSBDriver.dll");
Native.ProgrammerApi.LoadLibraryEx(@".\dll\x64\STLinkUSBDriver.dll", IntPtr.Zero, 0);
}
else
{
Assembly.LoadFrom(@".\dll\x86\STLinkUSBDriver.dll");
Native.ProgrammerApi.LoadLibraryEx(@".\dll\x86\STLinkUSBDriver.dll", IntPtr.Zero, 0);
//Assembly.LoadFrom(@".\dll\x86\STLinkUSBDriver.dll");
}
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<None Include="..\..\..\Programmer\x86\STLinkUSBDriver.dll" Pack="true" PackagePath="runtimes\win-x86\native" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Win32\Release\*.dll" Pack="true" PackagePath="runtimes\win-x86\native\Programmer" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />-->
<None Include="..\..\..\Programmer\x64\*.dll" Pack="true" PackagePath="build\native\x64\Programmer" Visible="false" Exclude="**\STLinkUSBDriver.dll" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Programmer\x64\STLinkUSBDriver.dll" Pack="true" PackagePath="build\native\x64\native" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Programmer\x64\STLinkUSBDriver.dll" Pack="true" PackagePath="build\native\x64" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\x64\Release\*.dll" Pack="true" PackagePath="build\native\x64\Programmer" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Programmer\x86\*.dll" Pack="true" PackagePath="build\native\x86\Programmer" Visible="false" Exclude="**\STLinkUSBDriver.dll" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Programmer\x86\STLinkUSBDriver.dll" Pack="true" PackagePath="build\native\x86\native" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Programmer\x86\STLinkUSBDriver.dll" Pack="true" PackagePath="build\native\x86" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Win32\Release\*.dll" Pack="true" PackagePath="build\native\x86\Programmer" Visible="false" CopyToOutputDirectory="Never" CopyToPublishDirectory="Never" />
<None Include="..\..\..\Data_Base\*.*" Pack="true" PackagePath="contentFiles\Data_Base" Visible="false" />
<None Include="..\..\..\Programmer\FlashLoader\*.*" Pack="true" PackagePath="contentFiles\FlashLoader" Visible="false" />
Expand Down
3 changes: 3 additions & 0 deletions src/01/KSociety.SharpCubeProgrammer/Native/ProgrammerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ internal static class ProgrammerApi
private const string ProgrammerDll32 = @".\dll\x86\Programmer.dll";
private const string ProgrammerDll64 = @".\dll\x64\Programmer.dll";

[DllImport("kernel32.dll", CharSet = CharSet.Auto, EntryPoint = "LoadLibraryEx")]
internal static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, uint dwFlags);

#region [STLINK]

#region [GetStLinkList]
Expand Down
2 changes: 1 addition & 1 deletion src/01/Samples/Programming/Programming.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="KSociety.SharpCubeProgrammer" Version="0.0.69" />
<PackageReference Include="KSociety.SharpCubeProgrammer" Version="0.0.70" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1" />
Expand Down

0 comments on commit e6feb28

Please sign in to comment.