projects
/
debian
/
gnuradio
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82d944f
)
usrp: Added error checking on hash transfers
author
Thomas Tsou
<ttsou@vt.edu>
Fri, 2 Oct 2009 16:37:06 +0000
(12:37 -0400)
committer
Thomas Tsou
<ttsou@vt.edu>
Fri, 9 Oct 2009 17:38:00 +0000
(13:38 -0400)
usrp/host/lib/usrp_prims_common.cc
patch
|
blob
|
history
diff --git
a/usrp/host/lib/usrp_prims_common.cc
b/usrp/host/lib/usrp_prims_common.cc
index 70e90d7fed44cb93e97c47a83beb5f0a3219de1d..689f2154de42ab423c47c05251474b02ef8ddbf5 100644
(file)
--- a/
usrp/host/lib/usrp_prims_common.cc
+++ b/
usrp/host/lib/usrp_prims_common.cc
@@
-419,6
+419,10
@@
usrp_set_hash (libusb_device_handle *udh, int which,
// we use the Cypress firmware down load command to jam it in.
int r = _usb_control_transfer (udh, 0x40, 0xa0, hash_slot_addr[which], 0,
(unsigned char *) hash, USRP_HASH_SIZE, 1000);
// we use the Cypress firmware down load command to jam it in.
int r = _usb_control_transfer (udh, 0x40, 0xa0, hash_slot_addr[which], 0,
(unsigned char *) hash, USRP_HASH_SIZE, 1000);
+
+ if (r < 0)
+ fprintf (stderr, "usrp: failed to set hash: %i\n", r);
+
return r == USRP_HASH_SIZE;
}
return r == USRP_HASH_SIZE;
}
@@
-431,6
+435,10
@@
usrp_get_hash (libusb_device_handle *udh, int which,
// we use the Cypress firmware upload command to fetch it.
int r = _usb_control_transfer (udh, 0xc0, 0xa0, hash_slot_addr[which], 0,
(unsigned char *) hash, USRP_HASH_SIZE, 1000);
// we use the Cypress firmware upload command to fetch it.
int r = _usb_control_transfer (udh, 0xc0, 0xa0, hash_slot_addr[which], 0,
(unsigned char *) hash, USRP_HASH_SIZE, 1000);
+
+ if (r < 0)
+ fprintf (stderr, "usrp: failed to get hash: %i\n", r);
+
return r == USRP_HASH_SIZE;
}
return r == USRP_HASH_SIZE;
}