This patch contains two small urjtag fixes:
1. Failure of "detect" with TDO stuck should signal a urj_error, and not
just print warning message. The TDO-stuck value is included in the error
message. Behaviour in the command-line jtag tool isn't changed much, but
its helps with the language bindings.
2. Failure to find the requested usb cable now signals a urj_error,
instead of just logging a message. Again, "jtag" behaviour isn't affected
much, but its useful in language bindings; python code can check the error
code and try a different cable or whatever.diff --git a/urjtag/src/tap/cable/generic_usbconn.c
b/urjtag/src/tap/cable/generic_usbconn.c
index 03ea25a..514f825 100644
--- a/urjtag/src/tap/cable/generic_usbconn.c
+++ b/urjtag/src/tap/cable/generic_usbconn.c
@@ -136,10 +136,12 @@ urj_tap_cable_generic_usbconn_connect (urj_cable_t *cable,
if (!conn)
{
- // @@@@ RFHH make this into either the error from drivers->connect,
- // or urj_error_set (NOT_FOUND)
- urj_log (URJ_LOG_LEVEL_ERROR,
+ if (urj_error_get () == URJ_ERROR_OK)
+ {
+ urj_log (URJ_LOG_LEVEL_ERROR,
_("Couldn't connect to suitable USB device.\n"));
+ urj_error_set (URJ_ERROR_NOTFOUND, _("usb device"));
+ }
return URJ_STATUS_FAIL;
}
else
diff --git a/urjtag/src/tap/discovery.c b/urjtag/src/tap/discovery.c
index 33597cd..800f24d 100644
--- a/urjtag/src/tap/discovery.c
+++ b/urjtag/src/tap/discovery.c
@@ -117,7 +117,7 @@ urj_tap_detect_register_size (urj_chain_t *chain, int
maxlen)
if (tdo_stuck >= 0)
{
- urj_warning (_("TDO seems to be stuck at %d\n"), tdo_stuck);
+ urj_error_set(URJ_ERROR_NO_CHAIN, _("TDO seems to be stuck at %d"),
tdo_stuck);
}
return -1;
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development