From 64d1553850fa729e3d4bf0a1d496c47316ac0c34 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 1 Aug 2012 13:07:54 -0700 Subject: xcvr2450: disable transmit PAs when receiving --- host/lib/usrp/dboard/db_xcvr2450.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 9d0033a9a..439e1b35e 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010-2011 Ettus Research LLC +// Copyright 2010-2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #define HB_PA_TXIO LB_PA_OFF_TXIO #define LB_PA_TXIO HB_PA_OFF_TXIO #define TX_ENB_TXIO TX_EN_TXIO -#define TX_DIS_TXIO 0 +#define TX_DIS_TXIO (HB_PA_OFF_TXIO | LB_PA_OFF_TXIO) #define AD9515DIV_3_TXIO AD9515DIV_TXIO #define AD9515DIV_2_TXIO 0 -- cgit v1.2.3 From d18fc6f0f1fe934cd8684171d966561a36fb134c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 4 Aug 2012 14:02:09 -0400 Subject: usb: added recv buffer flushing to libusb zero copy --- host/lib/transport/libusb1_zero_copy.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index c13384eec..28bff9709 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010-2011 Ettus Research LLC +// Copyright 2010-2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -177,6 +177,23 @@ public: _handle->claim_interface(recv_interface); _handle->claim_interface(send_interface); + //flush the buffers out of the recv endpoint + //limit the flushing to at most one second + for (size_t i = 0; i < 100; i++) + { + unsigned char buff[512]; + int transfered = 0; + const int status = libusb_bulk_transfer( + _handle->get(), // dev_handle + (recv_endpoint & 0x7f) | 0x80, // endpoint + static_cast(buff), + sizeof(buff), + &transfered, //bytes xfered + 10 //timeout ms + ); + if (status == LIBUSB_ERROR_TIMEOUT) break; + } + //allocate libusb transfer structs and managed receive buffers for (size_t i = 0; i < get_num_recv_frames(); i++){ -- cgit v1.2.3