diff options
author | Johnathan Corgan | 2009-10-13 13:32:39 -0700 |
---|---|---|
committer | Johnathan Corgan | 2009-10-13 13:32:39 -0700 |
commit | c39a8c449b6a766ca5496c0f3e255b15c40c690d (patch) | |
tree | c64e754fcc11979755d12f30d99e24c9c69e7d27 /usrp/host/lib/usrp_prims_common.cc | |
parent | 6b0bbd512a12a1ec0309f0f8d38797c824ec1326 (diff) | |
parent | 6b626de1518b3897f8707acd7b920f19cc15da94 (diff) | |
download | gnuradio-c39a8c449b6a766ca5496c0f3e255b15c40c690d.tar.gz gnuradio-c39a8c449b6a766ca5496c0f3e255b15c40c690d.tar.bz2 gnuradio-c39a8c449b6a766ca5496c0f3e255b15c40c690d.zip |
Merge branch 'libusb-1.0' of git://github.com/ttsou/gnuradio-ttsou
This merge fixes libusb build machinery to work for Cygwin, Darwin, Ubuntu,
and F11.
* 'libusb-1.0' of git://github.com/ttsou/gnuradio-ttsou:
usrp: Applied patch from Michael Dickens for Darwin libusb
usrp: Applied patch from Don Ward for Cygwin libusb
fix to restart libusbok checking for non-PKGCONFIG
usrp: Disabled libusb-1.0 debug output by default
merged updated libusb checks with older version
usrp: Enable debug output
usrp: Reorg of libusb error reporting
usrp: Added error checking on hash transfers
augmented search for libusb
Diffstat (limited to 'usrp/host/lib/usrp_prims_common.cc')
-rw-r--r-- | usrp/host/lib/usrp_prims_common.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usrp/host/lib/usrp_prims_common.cc b/usrp/host/lib/usrp_prims_common.cc index 70e90d7fe..2d8a0fa2a 100644 --- a/usrp/host/lib/usrp_prims_common.cc +++ b/usrp/host/lib/usrp_prims_common.cc @@ -215,7 +215,7 @@ write_internal_ram (libusb_device_handle *udh, unsigned char *buf, (unsigned char*)(buf + (addr - start_addr)), n, 1000); if (a < 0){ - fprintf(stderr,"write_internal_ram failed: %i\n", a); + fprintf(stderr,"write_internal_ram failed\n"); return false; } } @@ -297,7 +297,7 @@ _usrp_load_firmware (libusb_device_handle *udh, const char *filename, break; } else if (type == 0x02){ - fprintf(stderr, "Extended address: whatever I do with it?\n"); + fprintf (stderr, "Extended address: whatever I do with it?\n"); fprintf (stderr, "%s: invalid line: \"%s\"\n", filename, s); goto fail; } @@ -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); + + if (r < 0) + fprintf (stderr, "usrp: failed to set hash\n"); + 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); + + if (r < 0) + fprintf (stderr, "usrp: failed to get hash\n"); + return r == USRP_HASH_SIZE; } |