[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10163 - gnuradio/branches/features/cppdb-test/usrp/ho
From: |
eb |
Subject: |
[Commit-gnuradio] r10163 - gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy |
Date: |
Tue, 23 Dec 2008 19:49:51 -0700 (MST) |
Author: eb
Date: 2008-12-23 19:49:48 -0700 (Tue, 23 Dec 2008)
New Revision: 10163
Modified:
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.cc
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.h
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_flexrf.cc
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.cc
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.h
Log:
Trial fix for shutdown problem. When tested with usrp_fft.py works for
File/Exit and
clicking the X, but doesn't call shutdown code when entering ^C from
command line. Could the ^C be getting caught by the gtk code underlying
wxPython?
Note, there's debugging code enabled for RFX boards. Test with an RFX
to see what's going on. Disable printfs before committing to trunk.
Modified: gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.cc
===================================================================
--- gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.cc
2008-12-23 23:56:12 UTC (rev 10162)
+++ gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.cc
2008-12-24 02:49:48 UTC (rev 10163)
@@ -38,7 +38,7 @@
/*****************************************************************************/
db_base::db_base(usrp_basic_sptr usrp, int which)
- : d_is_shutdown(false), d_weak_usrp(usrp), d_which(which), d_lo_offset(0.0)
+ : d_is_shutdown(false), d_raw_usrp(usrp.get()), d_which(which),
d_lo_offset(0.0)
{
}
Modified: gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.h
===================================================================
--- gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.h
2008-12-23 23:56:12 UTC (rev 10162)
+++ gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_base.h
2008-12-24 02:49:48 UTC (rev 10163)
@@ -46,7 +46,7 @@
{
protected:
bool d_is_shutdown;
- boost::weak_ptr<usrp_basic> d_weak_usrp;
+ usrp_basic *d_raw_usrp;
int d_which;
double d_lo_offset;
@@ -54,8 +54,8 @@
virtual double _refclk_freq();
virtual int _refclk_divisor();
- usrp_basic_sptr usrp(){
- return usrp_basic_sptr(d_weak_usrp); // throws bad_weak_ptr if
d_usrp.use_count() == 0
+ usrp_basic *usrp(){
+ return d_raw_usrp;
}
public:
Modified:
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_flexrf.cc
===================================================================
--- gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_flexrf.cc
2008-12-23 23:56:12 UTC (rev 10162)
+++ gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/db_flexrf.cc
2008-12-24 02:49:48 UTC (rev 10163)
@@ -282,6 +282,8 @@
void
flexrf_base_tx::shutdown()
{
+ fprintf(stderr, "flexrf_base_tx::shutdown d_is_shutdown = %d\n",
d_is_shutdown);
+
if (!d_is_shutdown){
d_is_shutdown = true;
// do whatever there is to do to shutdown
@@ -402,6 +404,8 @@
void
flexrf_base_rx::shutdown()
{
+ fprintf(stderr, "flexrf_base_rx::shutdown d_is_shutdown = %d\n",
d_is_shutdown);
+
if (!d_is_shutdown){
d_is_shutdown = true;
// do whatever there is to do to shutdown
@@ -412,9 +416,17 @@
// Power down VCO/PLL
d_PD = 3;
+
+ fprintf(stderr, "flexrf_base_rx::shutdown before _write_control\n");
_write_control(_compute_control_reg());
+
+ fprintf(stderr, "flexrf_base_rx::shutdown before _enable_refclk\n");
_enable_refclk(false); // turn off refclk
+
+ fprintf(stderr, "flexrf_base_rx::shutdown before set_auto_tr\n");
set_auto_tr(false);
+
+ fprintf(stderr, "flexrf_base_rx::shutdown after set_auto_tr\n");
}
}
Modified:
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.cc
===================================================================
--- gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.cc
2008-12-23 23:56:12 UTC (rev 10162)
+++ gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.cc
2008-12-24 02:49:48 UTC (rev 10163)
@@ -169,7 +169,7 @@
usrp_basic::~usrp_basic ()
{
- shutdown_daughterboards();
+ // shutdown_daughterboards(); // call from ~usrp_basic_{tx,rx}
d_db.resize(0); // forget db shared ptrs
@@ -843,6 +843,8 @@
if (!usrp_9862_write_many_all (d_udh, rx_fini_regs, sizeof (rx_fini_regs))){
fprintf (stderr, "usrp_basic_rx: failed to fini AD9862 RX regs\n");
}
+
+ shutdown_daughterboards();
}
@@ -1249,6 +1251,8 @@
if (!usrp_9862_write_many_all (d_udh, tx_fini_regs, sizeof (tx_fini_regs))){
fprintf (stderr, "usrp_basic_tx: failed to fini AD9862 TX regs\n");
}
+
+ shutdown_daughterboards();
}
bool
Modified:
gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.h
===================================================================
--- gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.h
2008-12-23 23:56:12 UTC (rev 10162)
+++ gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy/usrp_basic.h
2008-12-24 02:49:48 UTC (rev 10163)
@@ -61,7 +61,7 @@
*/
class usrp_basic : boost::noncopyable
{
-private:
+protected:
void shutdown_daughterboards();
protected:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10163 - gnuradio/branches/features/cppdb-test/usrp/host/lib/legacy,
eb <=