Skip to content
Snippets Groups Projects
Commit 0a33b7b2 authored by Spencer Oliver's avatar Spencer Oliver
Browse files

parport: fix parport_toggling_time regression


If parport_toggling_time is called before the adapter speed has been
configured then the call fails. Probably not the best fix, but does at least
enable parport_toggling_time to be used again.

This regression was added in commit 740b9e25

Change-Id: I90300916d6bda5ef053c557e5ac136c4f002bdd1
Signed-off-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1309
Tested-by: jenkins
parent 46bcaec6
No related branches found
No related tags found
No related merge requests found
...@@ -452,8 +452,13 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command) ...@@ -452,8 +452,13 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
parport_toggling_time_ns = ns; parport_toggling_time_ns = ns;
retval = jtag_get_speed(&wait_states); retval = jtag_get_speed(&wait_states);
if (retval != ERROR_OK) if (retval != ERROR_OK) {
return retval; /* if jtag_get_speed fails then the clock_mode
* has not been configured, this happens if parport_toggling_time is
* called before the adapter speed is set */
LOG_INFO("no parport speed set - defaulting to zero wait states");
wait_states = 0;
}
} }
command_print(CMD_CTX, "parport toggling time = %" PRIu32 " ns", command_print(CMD_CTX, "parport toggling time = %" PRIu32 " ns",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment