commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10754 - gnuradio/branches/developers/jcorgan/gpio2/us


From: jcorgan
Subject: [Commit-gnuradio] r10754 - gnuradio/branches/developers/jcorgan/gpio2/usrp2/host/lib
Date: Thu, 2 Apr 2009 20:37:15 -0600 (MDT)

Author: jcorgan
Date: 2009-04-02 20:37:15 -0600 (Thu, 02 Apr 2009)
New Revision: 10754

Modified:
   gnuradio/branches/developers/jcorgan/gpio2/usrp2/host/lib/usrp2_impl.cc
Log:
Cleanup debug and error checking

Modified: 
gnuradio/branches/developers/jcorgan/gpio2/usrp2/host/lib/usrp2_impl.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/gpio2/usrp2/host/lib/usrp2_impl.cc     
2009-04-03 01:54:43 UTC (rev 10753)
+++ gnuradio/branches/developers/jcorgan/gpio2/usrp2/host/lib/usrp2_impl.cc     
2009-04-03 02:37:15 UTC (rev 10754)
@@ -1295,9 +1295,10 @@
 
   bool usrp2::impl::set_gpio_ddr(int bank, uint16_t value, uint16_t mask)
   {
-    fprintf(stderr, "set_gpio_ddr: bank=%i, value=%04X, mask=%04X\n", bank, 
value, mask);
-    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK)
-      throw std::runtime_error("set_gpio_ddr: bank must be one of GPIO_RX_BANK 
or GPIO_TX_BANK");
+    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK) {
+      fprintf(stderr, "set_gpio_ddr: bank must be one of GPIO_RX_BANK or 
GPIO_TX_BANK\n");
+      return false;
+    }
 
     op_gpio_cmd cmd;
     op_generic_t reply;
@@ -1323,12 +1324,15 @@
 
   bool usrp2::impl::set_gpio_sels(int bank, std::string sels)
   {
-    fprintf(stderr, "set_gpio_sels: bank=%i, sels=%s\n", bank, sels.c_str());
-    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK)
-      throw std::runtime_error("set_gpio_ddr: bank must be one of GPIO_RX_BANK 
or GPIO_TX_BANK");
+    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK) {
+      fprintf(stderr, "set_gpio_ddr: bank must be one of GPIO_RX_BANK or 
GPIO_TX_BANK\n");
+      return false;
+    }
 
-    if (sels.size() != 16)
-      throw std::runtime_error("set_gpio_sels: sels must be exactly 16 bytes");
+    if (sels.size() != 16) {
+      fprintf(stderr, "set_gpio_sels: sels must be exactly 16 bytes\n");
+      return false;
+    }
 
     op_gpio_set_sels_cmd cmd;
     op_generic_t reply;
@@ -1353,9 +1357,10 @@
 
   bool usrp2::impl::write_gpio(int bank, uint16_t value, uint16_t mask)
   {
-    fprintf(stderr, "  write_gpio: bank=%i, value=%04X, mask=%04X\n", bank, 
value, mask);
-    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK)
-      throw std::runtime_error("set_gpio_ddr: bank must be one of GPIO_RX_BANK 
or GPIO_TX_BANK");
+    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK) {
+      fprintf(stderr, "set_gpio_ddr: bank must be one of GPIO_RX_BANK or 
GPIO_TX_BANK");
+      return false;
+    }
 
     op_gpio_cmd cmd;
     op_generic_t reply;
@@ -1381,9 +1386,10 @@
 
   bool usrp2::impl::read_gpio(int bank, uint16_t *value)
   {
-    fprintf(stderr, "   read_gpio: bank=%i, address@hidden", bank, value);
-    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK)
-      throw std::runtime_error("set_gpio_ddr: bank must be one of GPIO_RX_BANK 
or GPIO_TX_BANK");
+    if (bank != GPIO_TX_BANK && bank != GPIO_RX_BANK) {
+      fprintf(stderr, "set_gpio_ddr: bank must be one of GPIO_RX_BANK or 
GPIO_TX_BANK");
+      return false;
+    }
 
     op_gpio_cmd cmd;
     op_gpio_read_reply_t reply;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]