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

more firmware work #433

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions Source/v2/Meadow.CLI.Core/Firmware/FirmwareWriter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Meadow.CLI.Core.Internals.Dfu;
using Meadow.Hcom;
using Meadow.LibUsb;
using Microsoft.Extensions.Logging;
using System.Diagnostics;
Expand Down Expand Up @@ -56,4 +57,18 @@ await DfuUtils.FlashFile(
logger: logger,
format: DfuUtils.DfuFlashFormat.ConsoleOut);
}

public async Task WriteRuntimeWithHcom(IMeadowConnection connection, string firmwareFile, ILogger? logger = null)
{
if (connection.Device == null) throw new Exception("No connected device");

await connection.Device.WriteRuntime(firmwareFile);
}

public async Task WriteCoprocessorFilesWithHcom(IMeadowConnection connection, string[] files, ILogger? logger = null)
{
if (connection.Device == null) throw new Exception("No connected device");

await connection.Device.WriteCoprocessorFiles(files);
}
}
Loading