aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1/usrp1_impl.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-05-14 19:57:03 -0700
committerJosh Blum <josh@joshknows.com>2011-05-14 19:57:03 -0700
commitf991d3dc751e110425d4a0eed722f6de0fef4261 (patch)
treed147596eba8d16294d4131dec2f66ca5c653f37a /host/lib/usrp/usrp1/usrp1_impl.hpp
parent29a0c916dfdc2f960761c1bebcccc53478abd30c (diff)
downloaduhd-f991d3dc751e110425d4a0eed722f6de0fef4261.tar.gz
uhd-f991d3dc751e110425d4a0eed722f6de0fef4261.tar.bz2
uhd-f991d3dc751e110425d4a0eed722f6de0fef4261.zip
usrp1: apply conditional disables/enables to rx and tx
Scapped the old gnuradio code for information about VRQ_FPGA_SET_XX_ENABLE. It turns out that we should disabled + restore state when changing muxes or rates. The USRP seems to stream properly when receiving single and dual channel. Prior to this commit, tx was accicentally always disabled from a few commits ago.
Diffstat (limited to 'host/lib/usrp/usrp1/usrp1_impl.hpp')
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp
index f53894b29..69ad9b0a0 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.hpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.hpp
@@ -205,6 +205,45 @@ private:
size_t get_num_ddcs(void);
bool has_rx_halfband(void);
bool has_tx_halfband(void);
+
+ //handle the enables
+ bool _rx_enabled, _tx_enabled;
+ void enable_rx(bool enb){
+ _rx_enabled = enb;
+ _ctrl_transport->usrp_rx_enable(enb);
+ }
+ void enable_tx(bool enb){
+ _tx_enabled = enb;
+ _ctrl_transport->usrp_tx_enable(enb);
+ }
+
+ //conditionally disable and enable rx
+ bool disable_rx(void){
+ if (_rx_enabled){
+ enable_rx(false);
+ return true;
+ }
+ return false;
+ }
+ void restore_rx(bool last){
+ if (last != _rx_enabled){
+ enable_rx(last);
+ }
+ }
+
+ //conditionally disable and enable tx
+ bool disable_tx(void){
+ if (_tx_enabled){
+ enable_tx(false);
+ return true;
+ }
+ return false;
+ }
+ void restore_tx(bool last){
+ if (last != _tx_enabled){
+ enable_tx(last);
+ }
+ }
};
#endif /* INCLUDED_USRP1_IMPL_HPP */