Skip to content

Commit

Permalink
Merge pull request #184 from K-Society/experimental
Browse files Browse the repository at this point in the history
Fix fore async method.
  • Loading branch information
maniglia authored Jan 7, 2025
2 parents f859b2f + 53ac67e commit 2098156
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/01/KSociety.SharpCubeProgrammer/CubeProgrammerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public CubeProgrammerError Reset(DebugResetMode rstMode)
return output;
}

public async ValueTask<CubeProgrammerError> Reset(DebugResetMode rstMode, CancellationToken cancellationToken = default)
public async ValueTask<CubeProgrammerError> ResetAsync(DebugResetMode rstMode, CancellationToken cancellationToken = default)
{
return await Task.Run(() => this.Reset(rstMode), cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface ICubeProgrammerApiAsync : IAsyncDisposable
/// <summary>
/// This routine used to apply a target reset, use only with ST-LINK!.
/// </summary>
ValueTask<CubeProgrammerError> Reset(DebugResetMode rstMode, CancellationToken cancellationToken = default);
ValueTask<CubeProgrammerError> ResetAsync(DebugResetMode rstMode, CancellationToken cancellationToken = default);

#endregion

Expand Down
2 changes: 1 addition & 1 deletion src/01/Samples/Programming/Bindings/ProgrammerApi.cs
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();
builder.RegisterType<CubeProgrammerApi>().As<ICubeProgrammerApi>().As<ICubeProgrammerApiAsync>().SingleInstance();
}
}
}
2 changes: 2 additions & 0 deletions src/01/Samples/Programming/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal class Program
private static IConfigurationRoot? Configuration;
private static ILogger<Program>? Logger;
private static ICubeProgrammerApi? CubeProgrammerApi;
private static ICubeProgrammerApiAsync? CubeProgrammerApiAsync;

private static void Main(string[] args)
{
Expand All @@ -33,6 +34,7 @@ private static void Main(string[] args)
Logger.LogDebug("Resolve ICubeProgrammerApi...");

CubeProgrammerApi = container.Resolve<ICubeProgrammerApi>();
CubeProgrammerApiAsync = container.Resolve<ICubeProgrammerApiAsync>();

Console.WriteLine("Press a button to continue.");
Console.ReadLine();
Expand Down

0 comments on commit 2098156

Please sign in to comment.