hosted: Consolidate ident output.

This commit is contained in:
Uwe Bonnes 2020-12-05 17:34:16 +01:00
parent 0870b778c0
commit bd5f4c6ed5
3 changed files with 11 additions and 10 deletions

View File

@ -37,7 +37,6 @@
#include "ftdi_bmp.h" #include "ftdi_bmp.h"
#include "jlink.h" #include "jlink.h"
#include "cmsis_dap.h" #include "cmsis_dap.h"
#include "version.h"
#include "cl_utils.h" #include "cl_utils.h"
bmp_info_t info; bmp_info_t info;
@ -75,7 +74,6 @@ static BMP_CL_OPTIONS_t cl_opts;
void platform_init(int argc, char **argv) void platform_init(int argc, char **argv)
{ {
cl_opts.opt_idstring = "Blackmagic PC-Hosted";
cl_init(&cl_opts, argc, argv); cl_init(&cl_opts, argc, argv);
atexit(exit_function); atexit(exit_function);
signal(SIGTERM, sigterm_handler); signal(SIGTERM, sigterm_handler);

View File

@ -33,6 +33,7 @@
#include "target_internal.h" #include "target_internal.h"
#include "cl_utils.h" #include "cl_utils.h"
#include "bmp_hosted.h"
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
@ -113,17 +114,20 @@ static void bmp_munmap(struct mmap_data *map)
#endif #endif
} }
static void cl_help(char **argv, BMP_CL_OPTIONS_t *opt) static void cl_help(char **argv)
{ {
DEBUG_WARN("%s for: \n", opt->opt_idstring); bmp_ident(NULL);
DEBUG_WARN("\tBMP hosted %s\n\t\tfor ST-Link V2/3, CMSIS_DAP, JLINK and "
"LIBFTDI/MPSSE\n\n", FIRMWARE_VERSION);
DEBUG_WARN("Usage: %s [options]\n", argv[0]); DEBUG_WARN("Usage: %s [options]\n", argv[0]);
DEBUG_WARN("\t-h\t\t: This help.\n"); DEBUG_WARN("\t-h\t\t: This help.\n");
DEBUG_WARN("\t-v[bitmask]\t: Increasing verbosity. Bitmask:\n"); DEBUG_WARN("\t-v[bitmask]\t: Increasing verbosity. Bitmask:\n");
DEBUG_WARN("\t\t\t 1 = INFO, 2 = GDB, 4 = TARGET, 8 = PROBE, 16 = WIRE\n"); DEBUG_WARN("\t\t\t 1 = INFO, 2 = GDB, 4 = TARGET, 8 = PROBE, 16 = WIRE\n");
DEBUG_WARN("Probe selection arguments:\n"); DEBUG_WARN("Probe selection arguments:\n");
DEBUG_WARN("\t-d \"path\"\t: Use serial BMP device at \"path\"(Deprecated)\n"); DEBUG_WARN("\t-d \"path\"\t: Use serial BMP device at <path>");
#if HOSTED_BMP_ONLY == 1
DEBUG_WARN("\n");
#else
DEBUG_WARN(" Deprecated!\n");
#endif
DEBUG_WARN("\t-P <pos>\t: Use debugger found at position <pos>\n"); DEBUG_WARN("\t-P <pos>\t: Use debugger found at position <pos>\n");
DEBUG_WARN("\t-n <num>\t: Use target device found at position <num>\n"); DEBUG_WARN("\t-n <num>\t: Use target device found at position <num>\n");
DEBUG_WARN("\t-s \"serial\"\t: Use dongle with (partial) " DEBUG_WARN("\t-s \"serial\"\t: Use dongle with (partial) "
@ -166,7 +170,8 @@ void cl_init(BMP_CL_OPTIONS_t *opt, int argc, char **argv)
opt->opt_cable = optarg; opt->opt_cable = optarg;
break; break;
case 'h': case 'h':
cl_help(argv, opt); cl_debuglevel = 3;
cl_help(argv);
break; break;
case 'H': case 'H':
opt->opt_no_hl = true; opt->opt_no_hl = true;
@ -189,7 +194,6 @@ void cl_init(BMP_CL_OPTIONS_t *opt, int argc, char **argv)
opt->external_resistor_swd = true; opt->external_resistor_swd = true;
break; break;
case 'd': case 'd':
DEBUG_WARN("Deprecated!\n");
if (optarg) if (optarg)
opt->opt_device = optarg; opt->opt_device = optarg;
break; break;

View File

@ -54,7 +54,6 @@ typedef struct BMP_CL_OPTIONS_s {
int opt_target_dev; int opt_target_dev;
uint32_t opt_flash_start; uint32_t opt_flash_start;
size_t opt_flash_size; size_t opt_flash_size;
char *opt_idstring;
}BMP_CL_OPTIONS_t; }BMP_CL_OPTIONS_t;
void cl_init(BMP_CL_OPTIONS_t *opt, int argc, char **argv); void cl_init(BMP_CL_OPTIONS_t *opt, int argc, char **argv);