Skip to content

Commit

Permalink
Fixes in deploy and update nanodevice (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Jun 27, 2023
1 parent fb3439e commit f76d08c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ To update the firmware of a nano device with a local firmware file (for example
This file has to be a binary file with a valid nanoCLR from a build. No checks or validations are performed on the file content.

```console
nanoff --nanodevice --serialport COM9 --binfile "C:\nf-interpreter\build\nanoclr.bin"
nanoff --nanodevice --update --serialport COM9 --clrfile "C:\nf-interpreter\build\nanoclr.bin"
```

### Get details from a nano device
Expand Down
21 changes: 19 additions & 2 deletions nanoFirmwareFlasher.Library/NanoDeviceOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
if (attemptToLaunchBooter)
{
// try to reboot target
if (verbosity > VerbosityLevel.Normal)
if (verbosity >= VerbosityLevel.Normal)
{
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Rebooting...");
}

nanoDevice.DebugEngine.RebootDevice(RebootOptions.NormalReboot);

if (verbosity > VerbosityLevel.Normal)
if (verbosity >= VerbosityLevel.Normal)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("OK");
Expand Down Expand Up @@ -697,6 +697,23 @@ public ExitCodes DeployApplication(
{
Console.WriteLine("");
}

// try to reboot target
if (verbosity >= VerbosityLevel.Normal)
{
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Rebooting...");
}

// reboot device
nanoDevice.DebugEngine.RebootDevice(RebootOptions.NormalReboot);

if (verbosity >= VerbosityLevel.Normal)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("OK");
Console.ForegroundColor = ConsoleColor.White;
}
}

// all good here
Expand Down

0 comments on commit f76d08c

Please sign in to comment.