diff --git a/src/command.c b/src/command.c index 95f5a5dff2d..99119329073 100644 --- a/src/command.c +++ b/src/command.c @@ -212,10 +212,7 @@ static bool cmd_jtag_scan(target_s *target, int argc, const char **argv) (void)argc; (void)argv; - /* Call the sampling function only once, check for NULL, check for unimplemented and suppress the output */ - const char *const target_voltage = platform_target_voltage(); - if (target_voltage && strcmp(target_voltage, "Unknown") != 0) - gdb_outf("Target voltage: %s\n", target_voltage); + gdb_outf("Target voltage: %s\n", platform_target_voltage()); if (connect_assert_nrst) platform_nrst_set_val(true); /* will be deasserted after attach */ @@ -256,10 +253,7 @@ bool cmd_swd_scan(target_s *target, int argc, const char **argv) volatile uint32_t targetid = 0; if (argc > 1) targetid = strtoul(argv[1], NULL, 0); - /* Call the sampling function only once, check for NULL, check for unimplemented and suppress the output */ - const char *const target_voltage = platform_target_voltage(); - if (target_voltage && strcmp(target_voltage, "Unknown") != 0) - gdb_outf("Target voltage: %s\n", target_voltage); + gdb_outf("Target voltage: %s\n", platform_target_voltage()); if (connect_assert_nrst) platform_nrst_set_val(true); /* will be deasserted after attach */ @@ -300,10 +294,7 @@ bool cmd_auto_scan(target_s *t, int argc, const char **argv) (void)argc; (void)argv; - /* Call the sampling function only once, check for NULL, check for unimplemented and suppress the output */ - const char *const target_voltage = platform_target_voltage(); - if (target_voltage && strcmp(target_voltage, "Unknown") != 0) - gdb_outf("Target voltage: %s\n", target_voltage); + gdb_outf("Target voltage: %s\n", platform_target_voltage()); if (connect_assert_nrst) platform_nrst_set_val(true); /* will be deasserted after attach */ diff --git a/src/platforms/hosted/cli.c b/src/platforms/hosted/cli.c index ff6d9d1881f..69fe61940d0 100644 --- a/src/platforms/hosted/cli.c +++ b/src/platforms/hosted/cli.c @@ -480,10 +480,7 @@ int cl_execute(bmda_cli_options_s *opt) platform_nrst_set_val(opt->opt_connect_under_reset); if (opt->opt_mode == BMP_MODE_TEST) DEBUG_INFO("Running in Test Mode\n"); - /* Call the sampling function only once, check for NULL, check for unimplemented and suppress the output */ - const char *const target_voltage = platform_target_voltage(); - if (target_voltage && strcmp(target_voltage, "Unknown") != 0) - DEBUG_INFO("Target voltage: %s\n", target_voltage); + DEBUG_INFO("Target voltage: %s\n", platform_target_voltage()); if (!scan_for_targets(opt)) { DEBUG_ERROR("No target found\n");