Browse Source

command: Refactored display_target()

pull/947/head
dragonmux 2 years ago
committed by Piotr Esden-Tempski
parent
commit
567fc631f0
  1. 15
      src/command.c

15
src/command.c

@ -356,14 +356,13 @@ bool cmd_frequency(target *t, int argc, const char **argv)
static void display_target(int i, target *t, void *context) static void display_target(int i, target *t, void *context)
{ {
(void)context; (void)context;
if (!strcmp(target_driver_name(t), "ARM Cortex-M")) { const char attached = target_attached(t) ? '*' : ' ';
gdb_outf("***%2d%sUnknown %s Designer 0x%03x Partno 0x%03x %s\n", i, target_attached(t) ? " * " : " ", const char *const core_name = target_core_name(t);
target_driver_name(t), target_designer(t), target_idcode(t), if (!strcmp(target_driver_name(t), "ARM Cortex-M"))
(target_core_name(t)) ? target_core_name(t) : ""); gdb_outf("***%2d %c Unknown %s Designer 0x%03x Partno 0x%03x %s\n", i, attached, target_driver_name(t),
} else { target_designer(t), target_idcode(t), core_name ? core_name : "");
gdb_outf("%2d %c %s %s\n", i, target_attached(t) ? '*' : ' ', target_driver_name(t), else
(target_core_name(t)) ? target_core_name(t) : ""); gdb_outf("%2d %c %s %s\n", i, attached, target_driver_name(t), core_name ? core_name : "");
}
} }
bool cmd_targets(target *t, int argc, const char **argv) bool cmd_targets(target *t, int argc, const char **argv)

Loading…
Cancel
Save