Skip to content

Commit

Permalink
cl-utils: Display targets found.
Browse files Browse the repository at this point in the history
+ other small changes in DEBUG output.
  • Loading branch information
UweBonnes committed Mar 10, 2020
1 parent 65cb886 commit a7efe7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/platforms/pc-stlinkv2/stlinkv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ stlink Stlink;
static void exit_function(void)
{
libusb_exit(NULL);
DEBUG("\nCleanup\n");
DEBUG("Cleanup\n");
}

/* SIGTERM handler. */
Expand Down
10 changes: 10 additions & 0 deletions src/platforms/pc/cl_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ void cl_init(BMP_CL_OPTIONS_t *opt, int argc, char **argv)
}
}

static void display_target(int i, target *t, void *context)
{
(void)context;
DEBUG("*** %2d %c %s %s\n", i, target_attached(t)?'*':' ',
target_driver_name(t),
(target_core_name(t)) ? target_core_name(t): "");
}

int cl_execute(BMP_CL_OPTIONS_t *opt)
{
int res = -1;
Expand All @@ -253,6 +261,8 @@ int cl_execute(BMP_CL_OPTIONS_t *opt)
if (!num_targets) {
DEBUG("No target found\n");
return res;
} else {
target_foreach(display_target, NULL);
}
if (opt->opt_mode == BMP_MODE_TEST)
return 0;
Expand Down
1 change: 0 additions & 1 deletion src/target/adiv5.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ void adiv5_dp_unref(ADIv5_DP_t *dp)
void adiv5_ap_unref(ADIv5_AP_t *ap)
{
if (--(ap->refcnt) == 0) {
DEBUG("Unref AP\n");
adiv5_dp_unref(ap->dp);
free(ap);
}
Expand Down

0 comments on commit a7efe7c

Please sign in to comment.