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
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
12 changes: 4 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meadow.CLI
name: Meadow.CLI Packaging
env:
CLI_RELEASE_VERSION: 1.5.0.0
IDE_TOOLS_RELEASE_VERSION: 1.5.0
Expand All @@ -7,13 +7,9 @@ env:
VS_MAC_2022_VERSION: 17.6

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches: [ main ]

jobs:
build-and-optionally-publish-nuget:
Expand Down Expand Up @@ -592,4 +588,4 @@ jobs:
name: Publish VSCode Extension
run: |
cd vs-code
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}
19 changes: 17 additions & 2 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 @@ -35,7 +36,7 @@ public bool IsDfuDeviceAvailable(bool useLegacyLibUsb = false)
}
}

public async Task WriteOsWithDfu(string osFile, ILogger? logger = null, bool useLegacyLibUsb = false)
public Task WriteOsWithDfu(string osFile, ILogger? logger = null, bool useLegacyLibUsb = false)
{
var devices = GetLibUsbDevices(useLegacyLibUsb);

Expand All @@ -50,10 +51,24 @@ public async Task WriteOsWithDfu(string osFile, ILogger? logger = null, bool use

Debug.WriteLine($"DFU Writing file {osFile}");

await DfuUtils.FlashFile(
return DfuUtils.FlashFile(
osFile,
serialNumber,
logger: logger,
format: DfuUtils.DfuFlashFormat.ConsoleOut);
}

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

return connection.Device.WriteRuntime(firmwareFile);
}

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

return connection.Device.WriteCoprocessorFiles(files);
}
}