From 6e15babbf6bcfae41d09f0b74d9ec8794d0758f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 May 2024 20:17:15 +0100 Subject: [PATCH] Fix failed reporting of launching nanoBooter (#271) --- .../NanoDeviceOperations.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nanoFirmwareFlasher.Library/NanoDeviceOperations.cs b/nanoFirmwareFlasher.Library/NanoDeviceOperations.cs index 0521bc8e..7cc6338f 100644 --- a/nanoFirmwareFlasher.Library/NanoDeviceOperations.cs +++ b/nanoFirmwareFlasher.Library/NanoDeviceOperations.cs @@ -288,7 +288,7 @@ public async Task UpdateDeviceClrAsync( } } - bool attemptToLaunchBooter = false; + bool booterLaunched = false; if (nanoDevice.DebugEngine.IsConnectedTonanoCLR) { @@ -306,9 +306,9 @@ public async Task 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 && @@ -334,10 +334,10 @@ public async Task UpdateDeviceClrAsync( } else { - attemptToLaunchBooter = true; + booterLaunched = true; } - if (attemptToLaunchBooter && + if (booterLaunched && nanoDevice.Ping() == Debugger.WireProtocol.ConnectionSource.nanoBooter) { // get address for CLR block expected by device @@ -380,7 +380,7 @@ public async Task UpdateDeviceClrAsync( } } - if (attemptToLaunchBooter) + if (booterLaunched) { // try to reboot target if (verbosity >= VerbosityLevel.Normal) @@ -408,7 +408,7 @@ public async Task 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.");