command: Fixed a pile of type confusion in the command function arguments

This commit is contained in:
dragonmux 2022-07-26 12:17:08 +01:00 committed by Piotr Esden-Tempski
parent 823634e609
commit f33744aa6a
1 changed files with 34 additions and 34 deletions

View File

@ -45,15 +45,15 @@
#include <alloca.h> #include <alloca.h>
static bool cmd_version(target *t, int argc, char **argv); static bool cmd_version(target *t, int argc, const char **argv);
static bool cmd_help(target *t, int argc, char **argv); static bool cmd_help(target *t, int argc, const char **argv);
static bool cmd_jtag_scan(target *t, int argc, char **argv); static bool cmd_jtag_scan(target *t, int argc, const char **argv);
static bool cmd_swdp_scan(target *t, int argc, char **argv); static bool cmd_swdp_scan(target *t, int argc, const char **argv);
static bool cmd_auto_scan(target *t, int argc, char **argv); static bool cmd_auto_scan(target *t, int argc, const char **argv);
static bool cmd_frequency(target *t, int argc, char **argv); static bool cmd_frequency(target *t, int argc, const char **argv);
static bool cmd_targets(target *t, int argc, char **argv); static bool cmd_targets(target *t, int argc, const char **argv);
static bool cmd_morse(target *t, int argc, char **argv); static bool cmd_morse(target *t, int argc, const char **argv);
static bool cmd_halt_timeout(target *t, int argc, const char **argv); static bool cmd_halt_timeout(target *t, int argc, const char **argv);
static bool cmd_connect_reset(target *t, int argc, const char **argv); static bool cmd_connect_reset(target *t, int argc, const char **argv);
static bool cmd_reset(target *t, int argc, const char **argv); static bool cmd_reset(target *t, int argc, const char **argv);
@ -73,34 +73,34 @@ static bool cmd_debug_bmp(target *t, int argc, const char **argv);
#endif #endif
const command_t cmd_list[] = { const command_t cmd_list[] = {
{"version", (cmd_handler)cmd_version, "Display firmware version info"}, {"version", cmd_version, "Display firmware version info"},
{"help", (cmd_handler)cmd_help, "Display help for monitor commands"}, {"help", cmd_help, "Display help for monitor commands"},
{"jtag_scan", (cmd_handler)cmd_jtag_scan, "Scan JTAG chain for devices"}, {"jtag_scan", cmd_jtag_scan, "Scan JTAG chain for devices"},
{"swdp_scan", (cmd_handler)cmd_swdp_scan, "Scan SW-DP for devices"}, {"swdp_scan", cmd_swdp_scan, "Scan SW-DP for devices"},
{"auto_scan", (cmd_handler)cmd_auto_scan, "Automatically scan all chain types for devices"}, {"auto_scan", cmd_auto_scan, "Automatically scan all chain types for devices"},
{"frequency", (cmd_handler)cmd_frequency, "set minimum high and low times"}, {"frequency", cmd_frequency, "set minimum high and low times"},
{"targets", (cmd_handler)cmd_targets, "Display list of available targets"}, {"targets", cmd_targets, "Display list of available targets"},
{"morse", (cmd_handler)cmd_morse, "Display morse error message"}, {"morse", cmd_morse, "Display morse error message"},
{"halt_timeout", (cmd_handler)cmd_halt_timeout, "Timeout (ms) to wait until Cortex-M is halted: (Default 2000)"}, {"halt_timeout", cmd_halt_timeout, "Timeout (ms) to wait until Cortex-M is halted: (Default 2000)"},
{"connect_rst", (cmd_handler)cmd_connect_reset, "Configure connect under reset: (enable|disable)"}, {"connect_rst", cmd_connect_reset, "Configure connect under reset: (enable|disable)"},
{"reset", (cmd_handler)cmd_reset, "Pulse the nRST line - disconnects target"}, {"reset", cmd_reset, "Pulse the nRST line - disconnects target"},
{"tdi_low_reset", (cmd_handler)cmd_tdi_low_reset, "Pulse nRST with TDI set low to attempt to wake certain targets up (eg LPC82x)"}, {"tdi_low_reset", cmd_tdi_low_reset, "Pulse nRST with TDI set low to attempt to wake certain targets up (eg LPC82x)"},
#ifdef PLATFORM_HAS_POWER_SWITCH #ifdef PLATFORM_HAS_POWER_SWITCH
{"tpwr", (cmd_handler)cmd_target_power, "Supplies power to the target: (enable|disable)"}, {"tpwr", cmd_target_power, "Supplies power to the target: (enable|disable)"},
#endif #endif
#ifdef ENABLE_RTT #ifdef ENABLE_RTT
{"rtt", (cmd_handler)cmd_rtt, "enable|disable|status|channel 0..15|ident (str)|cblock|poll maxms minms maxerr"}, {"rtt", cmd_rtt, "enable|disable|status|channel 0..15|ident (str)|cblock|poll maxms minms maxerr"},
#endif #endif
#ifdef PLATFORM_HAS_TRACESWO #ifdef PLATFORM_HAS_TRACESWO
#if defined TRACESWO_PROTOCOL && TRACESWO_PROTOCOL == 2 #if defined TRACESWO_PROTOCOL && TRACESWO_PROTOCOL == 2
{"traceswo", (cmd_handler)cmd_traceswo, "Start trace capture, NRZ mode: (baudrate) (decode channel ...)"}, {"traceswo", cmd_traceswo, "Start trace capture, NRZ mode: (baudrate) (decode channel ...)"},
#else #else
{"traceswo", (cmd_handler)cmd_traceswo, "Start trace capture, Manchester mode: (decode channel ...)"}, {"traceswo", cmd_traceswo, "Start trace capture, Manchester mode: (decode channel ...)"},
#endif #endif
#endif #endif
{"heapinfo", (cmd_handler)cmd_heapinfo, "Set semihosting heapinfo"}, {"heapinfo", cmd_heapinfo, "Set semihosting heapinfo"},
#if defined(PLATFORM_HAS_DEBUG) && (PC_HOSTED == 0) #if defined(PLATFORM_HAS_DEBUG) && (PC_HOSTED == 0)
{"debug_bmp", (cmd_handler)cmd_debug_bmp, "Output BMP \"debug\" strings to the second vcom: (enable|disable)"}, {"debug_bmp", cmd_debug_bmp, "Output BMP \"debug\" strings to the second vcom: (enable|disable)"},
#endif #endif
{NULL, NULL, NULL}, {NULL, NULL, NULL},
}; };
@ -146,7 +146,7 @@ int command_process(target *t, char *cmd)
#define BOARD_IDENT "Black Magic Probe" PLATFORM_IDENT FIRMWARE_VERSION #define BOARD_IDENT "Black Magic Probe" PLATFORM_IDENT FIRMWARE_VERSION
bool cmd_version(target *t, int argc, char **argv) bool cmd_version(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
(void)argc; (void)argc;
@ -166,7 +166,7 @@ bool cmd_version(target *t, int argc, char **argv)
return true; return true;
} }
bool cmd_help(target *t, int argc, char **argv) bool cmd_help(target *t, int argc, const char **argv)
{ {
(void)argc; (void)argc;
(void)argv; (void)argv;
@ -185,7 +185,7 @@ bool cmd_help(target *t, int argc, char **argv)
return true; return true;
} }
static bool cmd_jtag_scan(target *t, int argc, char **argv) static bool cmd_jtag_scan(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
uint8_t irlens[argc]; uint8_t irlens[argc];
@ -232,7 +232,7 @@ static bool cmd_jtag_scan(target *t, int argc, char **argv)
return true; return true;
} }
bool cmd_swdp_scan(target *t, int argc, char **argv) bool cmd_swdp_scan(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
volatile uint32_t targetid = 0; volatile uint32_t targetid = 0;
@ -273,7 +273,7 @@ bool cmd_swdp_scan(target *t, int argc, char **argv)
return true; return true;
} }
bool cmd_auto_scan(target *t, int argc, char **argv) bool cmd_auto_scan(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
(void)argc; (void)argc;
@ -327,7 +327,7 @@ bool cmd_auto_scan(target *t, int argc, char **argv)
return true; return true;
} }
bool cmd_frequency(target *t, int argc, char **argv) bool cmd_frequency(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
if (argc == 2) { if (argc == 2) {
@ -364,7 +364,7 @@ static void display_target(int i, target *t, void *context)
} }
} }
bool cmd_targets(target *t, int argc, char **argv) bool cmd_targets(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
(void)argc; (void)argc;
@ -379,7 +379,7 @@ bool cmd_targets(target *t, int argc, char **argv)
return true; return true;
} }
bool cmd_morse(target *t, int argc, char **argv) bool cmd_morse(target *t, int argc, const char **argv)
{ {
(void)t; (void)t;
(void)argc; (void)argc;