Skip to content

Commit

Permalink
Fix failed reporting of launching nanoBooter (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored May 29, 2024
1 parent cf43d26 commit 6e15bab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nanoFirmwareFlasher.Library/NanoDeviceOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
}
}

bool attemptToLaunchBooter = false;
bool booterLaunched = false;

if (nanoDevice.DebugEngine.IsConnectedTonanoCLR)
{
Expand All @@ -306,9 +306,9 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
Console.ForegroundColor = ConsoleColor.White;
}

attemptToLaunchBooter = nanoDevice.ConnectToNanoBooter();
booterLaunched = nanoDevice.ConnectToNanoBooter();

if (!attemptToLaunchBooter)
if (!booterLaunched)
{
// check for version where the software reboot to nanoBooter was made available
if (currentClrVersion != null &&
Expand All @@ -334,10 +334,10 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
}
else
{
attemptToLaunchBooter = true;
booterLaunched = true;
}

if (attemptToLaunchBooter &&
if (booterLaunched &&
nanoDevice.Ping() == Debugger.WireProtocol.ConnectionSource.nanoBooter)
{
// get address for CLR block expected by device
Expand Down Expand Up @@ -380,7 +380,7 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
}
}

if (attemptToLaunchBooter)
if (booterLaunched)
{
// try to reboot target
if (verbosity >= VerbosityLevel.Normal)
Expand Down Expand Up @@ -408,7 +408,7 @@ public async Task<ExitCodes> UpdateDeviceClrAsync(
}
else
{
if (attemptToLaunchBooter)
if (!booterLaunched)
{
// only report this as an error if the launch was successful
throw new NanoDeviceOperationFailedException("Failed to launch nanoBooter. Quitting update.");
Expand Down

0 comments on commit 6e15bab

Please sign in to comment.