adapter: Improve three adapter-related prints
- Do not warn the user about adapter speed not being set if the selected adapter does not support configurable speed. This would be confusing to users. - Minor reword in the "adapter speed is not selected" warning. - Print the adapter name in the "adapter doesn't support configurable speed" log entry - Another minor reword: autoselect --> autoselecting Signed-off-by: Jan Matyas <matyas@codasip.com> Change-Id: I4c198b547544fd8199921f092153562c5f159134 Reviewed-on: https://review.openocd.org/c/openocd/+/7269 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
f2fc23e16b
commit
30631224da
|
@ -136,9 +136,11 @@ int adapter_init(struct command_context *cmd_ctx)
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (adapter_config.clock_mode == CLOCK_MODE_UNSELECTED) {
|
/* If the adapter supports configurable speed but the speed is not configured,
|
||||||
|
* provide a hint to the user. */
|
||||||
|
if (adapter_driver->speed && adapter_config.clock_mode == CLOCK_MODE_UNSELECTED) {
|
||||||
LOG_WARNING("An adapter speed is not selected in the init scripts."
|
LOG_WARNING("An adapter speed is not selected in the init scripts."
|
||||||
" OpenOCD will try to run the adapter at the low speed (%d kHz)",
|
" OpenOCD will try to run the adapter at very low speed (%d kHz).",
|
||||||
DEFAULT_CLOCK_SPEED_KHZ);
|
DEFAULT_CLOCK_SPEED_KHZ);
|
||||||
LOG_WARNING("To remove this warnings and achieve reasonable communication speed with the target,"
|
LOG_WARNING("To remove this warnings and achieve reasonable communication speed with the target,"
|
||||||
" set \"adapter speed\" or \"jtag_rclk\" in the init scripts.");
|
" set \"adapter speed\" or \"jtag_rclk\" in the init scripts.");
|
||||||
|
@ -153,7 +155,7 @@ int adapter_init(struct command_context *cmd_ctx)
|
||||||
adapter_config.adapter_initialized = true;
|
adapter_config.adapter_initialized = true;
|
||||||
|
|
||||||
if (!adapter_driver->speed) {
|
if (!adapter_driver->speed) {
|
||||||
LOG_INFO("This adapter doesn't support configurable speed");
|
LOG_INFO("Note: The adapter \"%s\" doesn't support configurable speed", adapter_driver->name);
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ int allow_transports(struct command_context *ctx, const char * const *vector)
|
||||||
|
|
||||||
/* autoselect if there's no choice ... */
|
/* autoselect if there's no choice ... */
|
||||||
if (!vector[1]) {
|
if (!vector[1]) {
|
||||||
LOG_INFO("only one transport option; autoselect '%s'", vector[0]);
|
LOG_INFO("only one transport option; autoselecting '%s'", vector[0]);
|
||||||
return transport_select(ctx, vector[0]);
|
return transport_select(ctx, vector[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue