Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget update. #92

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ProgrammerApi : Module
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<CubeProgrammerApi>().As<ICubeProgrammerApi>().SingleInstance()
.OnActivated(programmer => programmer.Instance.GetStLinkPorts());
.OnActivated(async programmer => await programmer.Instance.GetStLinkPorts().ConfigureAwait(false));
}
}
}
10 changes: 7 additions & 3 deletions src/01/KSociety.SharpCubeProgrammer/CubeProgrammerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ private void Init()
}
}

public async void GetStLinkPorts(CancellationToken cancellationToken = default)
public async ValueTask GetStLinkPorts(CancellationToken cancellationToken = default)
{
await this.RegisterStLinkEvents(cancellationToken);
await this.RegisterStm32BootLoaderEvents(cancellationToken);
await this.RegisterStLinkEvents(cancellationToken).ConfigureAwait(false);
await this.RegisterStm32BootLoaderEvents(cancellationToken).ConfigureAwait(false);
}

private async ValueTask RegisterStLinkEvents(CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -445,6 +445,10 @@ public bool CheckDeviceConnection()
{
this._logger?.LogError(ex, "GetDeviceGeneralInf: ");
}
finally
{
Marshal.DestroyStructure<GeneralInf>(pointer);
}

return generalInf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace KSociety.SharpCubeProgrammer.Interface
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using DeviceDataStructure;
using Enum;
using Events;
Expand All @@ -24,7 +25,7 @@ public interface ICubeProgrammerApi : IDisposable

bool Stm32BootLoaderReady { get; }

void GetStLinkPorts(CancellationToken cancellationToken = default);
ValueTask GetStLinkPorts(CancellationToken cancellationToken = default);

#region [STLINK]

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

<ItemGroup>
<PackageReference Include="KSociety.Wmi" Version="0.0.37" />
<PackageReference Include="KSociety.Wmi" Version="0.0.46" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/01/KSociety.Test/KSociety.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="KSociety.Log.Serilog.Sinks.XUnit" Version="1.2.74" />
<PackageReference Include="KSociety.Log.Serilog.Sinks.XUnit" Version="1.2.77" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
Expand Down