From dde75f186da41c5827ea01be41295619cfbd1638 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sun, 14 Aug 2022 18:12:28 +0100 Subject: [PATCH] command: Cleaned up in the auto_scan command routine --- src/command.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index fdd4145..413c77c 100644 --- a/src/command.c +++ b/src/command.c @@ -310,10 +310,7 @@ bool cmd_auto_scan(target *t, int argc, const char **argv) if (devs > 0) break; - platform_target_clk_output_enable(false); - platform_nrst_set_val(false); - gdb_out("SW-DP scan failed!\n"); - return false; + gdb_out("SW-DP scan found no devices.\n"); } switch (e.type) { case EXCEPTION_TIMEOUT: @@ -323,6 +320,7 @@ bool cmd_auto_scan(target *t, int argc, const char **argv) gdb_outf("Exception: %s\n", e.msg); break; } + if (devs == 0) { platform_target_clk_output_enable(false); platform_nrst_set_val(false);