hosted/platform: Formatting consistency improvements

This commit is contained in:
dragonmux 2022-04-14 14:20:59 -04:00 committed by Rachel Mant
parent ba8ed132a8
commit a27661cd0b
1 changed files with 7 additions and 10 deletions

View File

@ -76,11 +76,10 @@ void platform_init(int argc, char **argv)
atexit(exit_function); atexit(exit_function);
signal(SIGTERM, sigterm_handler); signal(SIGTERM, sigterm_handler);
signal(SIGINT, sigterm_handler); signal(SIGINT, sigterm_handler);
if (cl_opts.opt_device) { if (cl_opts.opt_device)
info.bmp_type = BMP_TYPE_BMP; info.bmp_type = BMP_TYPE_BMP;
} else if (find_debuggers(&cl_opts, &info)) { else if (find_debuggers(&cl_opts, &info))
exit(-1); exit(-1);
}
bmp_ident(&info); bmp_ident(&info);
switch (info.bmp_type) { switch (info.bmp_type) {
case BMP_TYPE_BMP: case BMP_TYPE_BMP:
@ -89,11 +88,11 @@ void platform_init(int argc, char **argv)
remote_init(); remote_init();
break; break;
case BMP_TYPE_STLINKV2: case BMP_TYPE_STLINKV2:
if (stlink_init( &info)) if (stlink_init(&info))
exit(-1); exit(-1);
break; break;
case BMP_TYPE_CMSIS_DAP: case BMP_TYPE_CMSIS_DAP:
if (dap_init( &info)) if (dap_init(&info))
exit(-1); exit(-1);
break; break;
case BMP_TYPE_LIBFTDI: case BMP_TYPE_LIBFTDI:
@ -107,14 +106,12 @@ void platform_init(int argc, char **argv)
default: default:
exit(-1); exit(-1);
} }
int ret = -1; if (cl_opts.opt_mode != BMP_MODE_DEBUG)
if (cl_opts.opt_mode != BMP_MODE_DEBUG) { exit(cl_execute(&cl_opts));
ret = cl_execute(&cl_opts); else {
} else {
gdb_if_init(); gdb_if_init();
return; return;
} }
exit(ret);
} }
int platform_adiv5_swdp_scan(uint32_t targetid) int platform_adiv5_swdp_scan(uint32_t targetid)