summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreb2007-09-05 20:18:28 +0000
committereb2007-09-05 20:18:28 +0000
commit73b85d7840a0694b9deafc75e081dd67cb935169 (patch)
treec8d4f6c40275bf2c7d9fd7e35604b719d80ad62a
parentbdae13c6aae7a5190e25dfb41e546382e9c6def3 (diff)
downloadgnuradio-73b85d7840a0694b9deafc75e081dd67cb935169.tar.gz
gnuradio-73b85d7840a0694b9deafc75e081dd67cb935169.tar.bz2
gnuradio-73b85d7840a0694b9deafc75e081dd67cb935169.zip
Merged eb/usrp-la r6317:6320 into trunk. This deborks the dependency
on usrp-inband that was introduced in [6307]. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6321 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--Makefile.common9
-rw-r--r--config/grc_usrp.m41
-rw-r--r--usrp/host/Makefile.am4
-rw-r--r--usrp/host/apps-inband/Makefile.am64
-rw-r--r--usrp/host/apps-inband/read_packets.cc (renamed from usrp/host/apps/read_packets.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_cs.cc (renamed from usrp/host/apps/test_usrp_inband_cs.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_ping.cc (renamed from usrp/host/apps/test_usrp_inband_ping.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_registers.cc (renamed from usrp/host/apps/test_usrp_inband_registers.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_rx.cc (renamed from usrp/host/apps/test_usrp_inband_rx.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_timestamps.cc (renamed from usrp/host/apps/test_usrp_inband_timestamps.cc)0
-rw-r--r--usrp/host/apps-inband/test_usrp_inband_tx.cc (renamed from usrp/host/apps/test_usrp_inband_tx.cc)0
-rw-r--r--usrp/host/apps-inband/time_stuff.c68
-rw-r--r--usrp/host/apps-inband/time_stuff.h48
-rw-r--r--usrp/host/apps-inband/ui_nco.h (renamed from usrp/host/apps/ui_nco.h)0
-rw-r--r--usrp/host/apps-inband/ui_sincos.c (renamed from usrp/host/apps/ui_sincos.c)0
-rw-r--r--usrp/host/apps-inband/ui_sincos.h (renamed from usrp/host/apps/ui_sincos.h)0
-rw-r--r--usrp/host/apps/Makefile.am38
-rw-r--r--usrp/host/lib/inband/Makefile.am9
18 files changed, 194 insertions, 47 deletions
diff --git a/Makefile.common b/Makefile.common
index 33a3a7c2a..fd14144b3 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -74,11 +74,12 @@ GNURADIO_I = $(top_srcdir)/gnuradio-core/src/lib/swig/gnuradio.i
# How to link in the USRP library from inside the tree
USRP_INCLUDES = -I$(top_srcdir)/usrp/host/lib/legacy \
- -I$(top_srcdir)/usrp/host/lib/inband \
-I$(top_srcdir)/usrp/firmware/include
-USRP_LA = \
- $(top_builddir)/usrp/host/lib/legacy/libusrp.la \
- $(top_builddir)/usrp/host/lib/inband/libusrp_inband.la
+USRP_LA = $(top_builddir)/usrp/host/lib/legacy/libusrp.la
+
+# How to link in usrp-inband library from inside the tree
+USRP_INBAND_INCLUDES = -I$(top_srcdir)/usrp/host/lib/inband
+USRP_INBAND_LA = $(top_builddir)/usrp/host/lib/inband/libusrp_inband.la
# How to link the PMT library from inside the tree
PMT_INCLUDES = -I$(top_srcdir)/pmt/src/lib
diff --git a/config/grc_usrp.m4 b/config/grc_usrp.m4
index 7462c8835..cc4f6a176 100644
--- a/config/grc_usrp.m4
+++ b/config/grc_usrp.m4
@@ -36,6 +36,7 @@ AC_DEFUN([GRC_USRP],[
usrp/host/lib/legacy/std_paths.h \
usrp/host/swig/Makefile \
usrp/host/apps/Makefile \
+ usrp/host/apps-inband/Makefile \
usrp/firmware/Makefile \
usrp/firmware/include/Makefile \
usrp/firmware/lib/Makefile \
diff --git a/usrp/host/Makefile.am b/usrp/host/Makefile.am
index 9b72209cf..1716f513d 100644
--- a/usrp/host/Makefile.am
+++ b/usrp/host/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,5 +19,5 @@
# Boston, MA 02110-1301, USA.
#
-SUBDIRS = misc lib swig apps
+SUBDIRS = misc lib swig apps apps-inband
diff --git a/usrp/host/apps-inband/Makefile.am b/usrp/host/apps-inband/Makefile.am
new file mode 100644
index 000000000..a63cb8ba0
--- /dev/null
+++ b/usrp/host/apps-inband/Makefile.am
@@ -0,0 +1,64 @@
+#
+# Copyright 2003,2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+INCLUDES = \
+ $(DEFINES) $(OMNITHREAD_INCLUDES) $(PMT_INCLUDES) $(MBLOCK_INCLUDES) \
+ $(USRP_INCLUDES) $(USRP_INBAND_INCLUDES) $(BOOST_CFLAGS) $(CPPUNIT_INCLUDES)
+
+
+bin_PROGRAMS =
+
+noinst_PROGRAMS = \
+ test_usrp_inband_cs \
+ test_usrp_inband_ping \
+ test_usrp_inband_registers \
+ test_usrp_inband_rx \
+ test_usrp_inband_tx \
+ test_usrp_inband_timestamps \
+ read_packets
+
+noinst_HEADERS = \
+ ui_nco.h \
+ ui_sincos.h
+
+
+test_usrp_inband_cs_SOURCES = test_usrp_inband_cs.cc ui_sincos.c
+test_usrp_inband_cs_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+test_usrp_inband_ping_SOURCES = test_usrp_inband_ping.cc
+test_usrp_inband_ping_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+test_usrp_inband_tx_SOURCES = test_usrp_inband_tx.cc ui_sincos.c
+test_usrp_inband_tx_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+test_usrp_inband_timestamps_SOURCES = test_usrp_inband_timestamps.cc ui_sincos.c
+test_usrp_inband_timestamps_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+test_usrp_inband_registers_SOURCES = test_usrp_inband_registers.cc ui_sincos.c
+test_usrp_inband_registers_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+test_usrp_inband_rx_SOURCES = test_usrp_inband_rx.cc ui_sincos.c
+test_usrp_inband_rx_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
+read_packets_SOURCES = read_packets.cc
+read_packets_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
diff --git a/usrp/host/apps/read_packets.cc b/usrp/host/apps-inband/read_packets.cc
index 92d8baf0d..92d8baf0d 100644
--- a/usrp/host/apps/read_packets.cc
+++ b/usrp/host/apps-inband/read_packets.cc
diff --git a/usrp/host/apps/test_usrp_inband_cs.cc b/usrp/host/apps-inband/test_usrp_inband_cs.cc
index 1d70341fe..1d70341fe 100644
--- a/usrp/host/apps/test_usrp_inband_cs.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_cs.cc
diff --git a/usrp/host/apps/test_usrp_inband_ping.cc b/usrp/host/apps-inband/test_usrp_inband_ping.cc
index a68f49272..a68f49272 100644
--- a/usrp/host/apps/test_usrp_inband_ping.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_ping.cc
diff --git a/usrp/host/apps/test_usrp_inband_registers.cc b/usrp/host/apps-inband/test_usrp_inband_registers.cc
index 922b6215d..922b6215d 100644
--- a/usrp/host/apps/test_usrp_inband_registers.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_registers.cc
diff --git a/usrp/host/apps/test_usrp_inband_rx.cc b/usrp/host/apps-inband/test_usrp_inband_rx.cc
index 4820c2d4e..4820c2d4e 100644
--- a/usrp/host/apps/test_usrp_inband_rx.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_rx.cc
diff --git a/usrp/host/apps/test_usrp_inband_timestamps.cc b/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
index d48c2a789..d48c2a789 100644
--- a/usrp/host/apps/test_usrp_inband_timestamps.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
diff --git a/usrp/host/apps/test_usrp_inband_tx.cc b/usrp/host/apps-inband/test_usrp_inband_tx.cc
index 18d36213b..18d36213b 100644
--- a/usrp/host/apps/test_usrp_inband_tx.cc
+++ b/usrp/host/apps-inband/test_usrp_inband_tx.cc
diff --git a/usrp/host/apps-inband/time_stuff.c b/usrp/host/apps-inband/time_stuff.c
new file mode 100644
index 000000000..89a4a3815
--- /dev/null
+++ b/usrp/host/apps-inband/time_stuff.c
@@ -0,0 +1,68 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2003 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "time_stuff.h"
+
+#include <sys/time.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#include <unistd.h>
+
+static double
+timeval_to_secs (struct timeval *tv)
+{
+ return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6;
+}
+
+double
+get_cpu_usage (void)
+{
+#ifdef HAVE_GETRUSAGE
+ struct rusage ru;
+
+ if (getrusage (RUSAGE_SELF, &ru) != 0)
+ return 0;
+
+ return timeval_to_secs (&ru.ru_utime) + timeval_to_secs (&ru.ru_stime);
+#else
+ return 0; /* FIXME */
+#endif
+}
+
+/*
+ * return elapsed time (wall time) in seconds
+ */
+double
+get_elapsed_time (void)
+{
+ struct timeval tv;
+ if (gettimeofday (&tv, 0) != 0)
+ return 0;
+
+ return timeval_to_secs (&tv);
+}
+
diff --git a/usrp/host/apps-inband/time_stuff.h b/usrp/host/apps-inband/time_stuff.h
new file mode 100644
index 000000000..74b79f388
--- /dev/null
+++ b/usrp/host/apps-inband/time_stuff.h
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2003 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _TIME_STUFF_H_
+#define _TIME_STUFF_H_
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * return USER + SYS cpu time in seconds
+ */
+double get_cpu_usage (void);
+
+/*
+ * return elapsed time in seconds
+ */
+double get_elapsed_time (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _TIME_STUFF_H_ */
diff --git a/usrp/host/apps/ui_nco.h b/usrp/host/apps-inband/ui_nco.h
index e6d7814ab..e6d7814ab 100644
--- a/usrp/host/apps/ui_nco.h
+++ b/usrp/host/apps-inband/ui_nco.h
diff --git a/usrp/host/apps/ui_sincos.c b/usrp/host/apps-inband/ui_sincos.c
index 36ca89c7d..36ca89c7d 100644
--- a/usrp/host/apps/ui_sincos.c
+++ b/usrp/host/apps-inband/ui_sincos.c
diff --git a/usrp/host/apps/ui_sincos.h b/usrp/host/apps-inband/ui_sincos.h
index d2d6e4b76..d2d6e4b76 100644
--- a/usrp/host/apps/ui_sincos.h
+++ b/usrp/host/apps-inband/ui_sincos.h
diff --git a/usrp/host/apps/Makefile.am b/usrp/host/apps/Makefile.am
index e0f5b8cf4..971388406 100644
--- a/usrp/host/apps/Makefile.am
+++ b/usrp/host/apps/Makefile.am
@@ -21,9 +21,7 @@
include $(top_srcdir)/Makefile.common
-INCLUDES = \
- $(DEFINES) $(OMNITHREAD_INCLUDES) $(PMT_INCLUDES) $(MBLOCK_INCLUDES) \
- $(USRP_INCLUDES) $(BOOST_CFLAGS) $(CPPUNIT_INCLUDES)
+INCLUDES = $(USRP_INCLUDES) $(BOOST_CFLAGS) $(CPPUNIT_INCLUDES)
bin_PROGRAMS = \
@@ -32,20 +30,11 @@ bin_PROGRAMS = \
noinst_PROGRAMS = \
check_order_quickly \
- test_usrp_inband_cs \
- test_usrp_inband_ping \
- test_usrp_inband_registers \
- test_usrp_inband_rx \
- test_usrp_inband_tx \
- test_usrp_inband_timestamps \
test_usrp_standard_rx \
- test_usrp_standard_tx \
- read_packets
+ test_usrp_standard_tx
noinst_HEADERS = \
- time_stuff.h \
- ui_nco.h \
- ui_sincos.h
+ time_stuff.h
noinst_PYTHON = \
burn-db-eeprom \
@@ -65,24 +54,3 @@ usrper_LDADD = $(USRP_LA)
usrp_cal_dc_offset_SOURCES = usrp_cal_dc_offset.cc
usrp_cal_dc_offset_LDADD = $(USRP_LA)
-
-test_usrp_inband_cs_SOURCES = test_usrp_inband_cs.cc time_stuff.c ui_sincos.c
-test_usrp_inband_cs_LDADD = $(USRP_LA)
-
-test_usrp_inband_ping_SOURCES = test_usrp_inband_ping.cc time_stuff.c
-test_usrp_inband_ping_LDADD = $(USRP_LA)
-
-test_usrp_inband_tx_SOURCES = test_usrp_inband_tx.cc time_stuff.c ui_sincos.c
-test_usrp_inband_tx_LDADD = $(USRP_LA)
-
-test_usrp_inband_timestamps_SOURCES = test_usrp_inband_timestamps.cc time_stuff.c ui_sincos.c
-test_usrp_inband_timestamps_LDADD = $(USRP_LA)
-
-test_usrp_inband_registers_SOURCES = test_usrp_inband_registers.cc time_stuff.c ui_sincos.c
-test_usrp_inband_registers_LDADD = $(USRP_LA)
-
-test_usrp_inband_rx_SOURCES = test_usrp_inband_rx.cc time_stuff.c ui_sincos.c
-test_usrp_inband_rx_LDADD = $(USRP_LA)
-
-read_packets_SOURCES = read_packets.cc
-read_packets_LDADD = $(USRP_LA)
diff --git a/usrp/host/lib/inband/Makefile.am b/usrp/host/lib/inband/Makefile.am
index 76e769fbe..d0daf45c3 100644
--- a/usrp/host/lib/inband/Makefile.am
+++ b/usrp/host/lib/inband/Makefile.am
@@ -23,7 +23,7 @@ include $(top_srcdir)/Makefile.common
INCLUDES = \
$(DEFINES) $(OMNITHREAD_INCLUDES) $(PMT_INCLUDES) $(MBLOCK_INCLUDES) \
$(USRP_INCLUDES) $(BOOST_CFLAGS) $(CPPUNIT_INCLUDES) \
- -I$(srcdir)/../../apps
+ -I$(srcdir)/../../apps-inband
TESTS = test_inband
@@ -52,7 +52,7 @@ usrp_interface_mbh.cc : usrp_interface.mbh
libusrp_inband_la_SOURCES = \
$(BUILT_SOURCES) \
- ../../apps/ui_sincos.c \
+ $(srcdir)/../../apps-inband/ui_sincos.c \
usrp_inband_usb_packet.cc \
usrp_rx.cc \
usrp_rx_stub.cc \
@@ -65,7 +65,7 @@ libusrp_inband_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
libusrp_inband_la_LIBADD = \
$(MBLOCK_LA) \
- ../legacy/libusrp.la \
+ $(USRP_LA) \
-lstdc++
include_HEADERS = \
@@ -103,12 +103,9 @@ libusrp_inband_qa_la_SOURCES = \
# magic flags
libusrp_inband_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid-version
-# link against c++ standard library
libusrp_inband_qa_la_LIBADD = \
libusrp_inband.la \
$(CPPUNIT_LIBS) \
- ../legacy/libusrp.la \
- libusrp_inband.la \
-lstdc++
# ------------------------------------------------------------------------