Skip to content

Commit 17d05ed

Browse files
authored
Allow either bin or hex file to be used for STM32 DFU update (#241)
1 parent 338a5d5 commit 17d05ed

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

nanoFirmwareFlasher.Tool/Program.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,9 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
883883
var connectedStDfuDevices = StmDfuDevice.ListDevices();
884884
var connectedStJtagDevices = StmJtagDevice.ListDevices();
885885

886-
if (o.BinFile.Any() &&
887-
o.HexFile.Any() &&
888-
connectedStDfuDevices.Count != 0)
886+
if (connectedStDfuDevices.Count != 0 &&
887+
(o.BinFile.Any() ||
888+
o.HexFile.Any()))
889889
{
890890

891891
#region STM32 DFU options
@@ -940,11 +940,9 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
940940
#endregion
941941

942942
}
943-
else if (
944-
o.BinFile.Any() &&
945-
o.HexFile.Any() &&
946-
connectedStJtagDevices.Count != 0
947-
)
943+
else if (connectedStJtagDevices.Count != 0 &&
944+
(o.BinFile.Any() ||
945+
o.HexFile.Any()))
948946
{
949947
// this has to be a JTAG connected device
950948

0 commit comments

Comments
 (0)