Skip to content

Commit 4ca230f

Browse files
authored
Fixing DFU detection for PyBStick and DFU Driver installation (#208)
1 parent 129bad4 commit 4ca230f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

nanoFirmwareFlasher.Tool/Program.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
449449
{
450450
// easiest one: ESP32
451451
if (o.TargetName.StartsWith("ESP")
452-
|| o.TargetName.StartsWith("M5")
453-
|| o.TargetName.StartsWith("Pyb")
452+
|| o.TargetName.StartsWith("M5")
454453
|| o.TargetName.StartsWith("FEATHER")
455454
|| o.TargetName.StartsWith("ESPKALUGA"))
456455
{
@@ -464,6 +463,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
464463
|| o.TargetName.StartsWith("IngenuityMicro")
465464
|| o.TargetName.StartsWith("WeAct")
466465
|| o.TargetName.StartsWith("ORGPAL")
466+
|| o.TargetName.StartsWith("Pyb")
467467
)
468468
{
469469
// candidates for STM32
@@ -509,17 +509,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
509509
!string.IsNullOrEmpty(o.DfuDeviceId))
510510
{
511511
o.Platform = SupportedPlatform.stm32;
512-
}
513-
// ESP32 related
514-
else if (
515-
!string.IsNullOrEmpty(o.SerialPort) ||
516-
(o.BaudRate != 921600) ||
517-
(o.Esp32FlashMode != "dio") ||
518-
(o.Esp32FlashFrequency != 40) ||
519-
!string.IsNullOrEmpty(o.Esp32ClrFile))
520-
{
521-
o.Platform = SupportedPlatform.esp32;
522-
}
512+
}
523513
// GG11 related
524514
else if (o.ListJLinkDevices)
525515
{
@@ -536,6 +526,16 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
536526
{
537527
o.Platform = SupportedPlatform.stm32;
538528
}
529+
// ESP32 related
530+
else if (
531+
!string.IsNullOrEmpty(o.SerialPort) ||
532+
(o.BaudRate != 921600) ||
533+
(o.Esp32FlashMode != "dio") ||
534+
(o.Esp32FlashFrequency != 40) ||
535+
!string.IsNullOrEmpty(o.Esp32ClrFile))
536+
{
537+
o.Platform = SupportedPlatform.esp32;
538+
}
539539
}
540540

541541
#endregion

0 commit comments

Comments
 (0)