diff options
author | jcorgan | 2009-03-03 02:10:36 +0000 |
---|---|---|
committer | jcorgan | 2009-03-03 02:10:36 +0000 |
commit | 4c400067338be2d8c2d76b0773dd4087d61b159b (patch) | |
tree | bc10354c799544b7e62a4bfca6690ac6d092d857 /gr-gpio | |
parent | 771f4e5e434fdc1d0b1fdd4191b28e6843d87094 (diff) | |
download | gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.tar.gz gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.tar.bz2 gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.zip |
Merged r10539:10546 from michaelld/two_mods into trunk. Trunk passes distcheck.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10551 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-gpio')
-rw-r--r-- | gr-gpio/src/Makefile.am | 4 | ||||
-rw-r--r-- | gr-gpio/src/lib/Makefile.am | 85 | ||||
-rw-r--r-- | gr-gpio/src/lib/gpio.i | 43 | ||||
-rw-r--r-- | gr-gpio/src/lib/gpio_and_const_ss.cc | 71 | ||||
-rw-r--r-- | gr-gpio/src/lib/gpio_and_const_ss.h | 54 | ||||
-rw-r--r-- | gr-gpio/src/python/Makefile.am | 11 | ||||
-rwxr-xr-x | gr-gpio/src/python/gpio_rx_sfile.py | 6 | ||||
-rwxr-xr-x | gr-gpio/src/python/gpio_usrp_fft.py | 6 | ||||
-rwxr-xr-x | gr-gpio/src/python/qa_gpio.py | 36 | ||||
-rw-r--r-- | gr-gpio/src/python/run_tests.in | 10 |
10 files changed, 8 insertions, 318 deletions
diff --git a/gr-gpio/src/Makefile.am b/gr-gpio/src/Makefile.am index 8a361801f..8c9a64b8b 100644 --- a/gr-gpio/src/Makefile.am +++ b/gr-gpio/src/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,4 +19,4 @@ # Boston, MA 02110-1301, USA. # -SUBDIRS = lib python fpga +SUBDIRS = python fpga diff --git a/gr-gpio/src/lib/Makefile.am b/gr-gpio/src/lib/Makefile.am deleted file mode 100644 index 1d2451f1c..000000000 --- a/gr-gpio/src/lib/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -# -# Copyright 2004,2005,2006,2007,2008,2009 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 - -ourpythondir = $(grpythondir)/gpio -ourlibdir = $(grpyexecdir)/gpio - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -ALL_IFILES = \ - $(LOCAL_IFILES) \ - $(NON_LOCAL_IFILES) - -NON_LOCAL_IFILES = $(GNURADIO_I) - -LOCAL_IFILES = \ - $(srcdir)/gpio.i - -# These files are built by SWIG. The first is the C++ glue. -# The second is the python wrapper that loads the _gpio shared library -# and knows how to call our extensions. - -BUILT_SOURCES = \ - gpio_swig.cc \ - gpio_swig.py - -# This gets gpio.py installed in the right place -ourpython_PYTHON = \ - gpio_swig.py - -ourlib_LTLIBRARIES = _gpio_swig.la - -# These are the source files that go into the shared library -_gpio_swig_la_SOURCES = \ - gpio_swig.cc \ - gpio_and_const_ss.cc - -# magic flags -_gpio_swig_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version - -# link the library against some comon swig runtime code and the -# c++ standard library -_gpio_swig_la_LIBADD = \ - $(PYTHON_LDFLAGS) \ - $(GNURADIO_CORE_LA) \ - -lstdc++ - -gpio_swig.cc gpio_swig.py: $(ALL_IFILES) - $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module gpio_swig \ - -o gpio_swig.cc $(LOCAL_IFILES) - -# These headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - gpio_and_const_ss.h - -# These swig headers get installed in ${prefix}/include/gnuradio/swig -swiginclude_HEADERS = \ - $(LOCAL_IFILES) - - -# Don't distribute output of swig -dist-hook: - @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done - @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done - -MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc *~ diff --git a/gr-gpio/src/lib/gpio.i b/gr-gpio/src/lib/gpio.i deleted file mode 100644 index b65777d3c..000000000 --- a/gr-gpio/src/lib/gpio.i +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 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 "gnuradio.i" // the common stuff - -%{ -#include "gpio_and_const_ss.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(gpio,and_const_ss) - -gpio_and_const_ss_sptr gpio_make_and_const_ss (unsigned short k); - -class gpio_and_const_ss : public gr_sync_block -{ - private: - gpio_and_const_ss (unsigned short k); - - public: - unsigned short k () const { return d_k; } - void set_k (unsigned short k) { d_k = k; } -}; diff --git a/gr-gpio/src/lib/gpio_and_const_ss.cc b/gr-gpio/src/lib/gpio_and_const_ss.cc deleted file mode 100644 index e93046199..000000000 --- a/gr-gpio/src/lib/gpio_and_const_ss.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 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 <gpio_and_const_ss.h> -#include <gr_io_signature.h> - -gpio_and_const_ss_sptr -gpio_make_and_const_ss (unsigned short k) -{ - return gpio_and_const_ss_sptr (new gpio_and_const_ss (k)); -} - -gpio_and_const_ss::gpio_and_const_ss (unsigned short k) - : gr_sync_block ("and_const_ss", - gr_make_io_signature (1, 1, sizeof (short)), - gr_make_io_signature (1, 1, sizeof (short))), - d_k (k) -{ -} - -int -gpio_and_const_ss::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - short *iptr = (short *) input_items[0]; - short *optr = (short *) output_items[0]; - - int size = noutput_items; - - while (size >= 8){ - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - *optr++ = *iptr++ & d_k; - size -= 8; - } - - while (size-- > 0) - *optr++ = *iptr++ & d_k; - - return noutput_items; -} diff --git a/gr-gpio/src/lib/gpio_and_const_ss.h b/gr-gpio/src/lib/gpio_and_const_ss.h deleted file mode 100644 index e27134d63..000000000 --- a/gr-gpio/src/lib/gpio_and_const_ss.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 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 INCLUDED_GPIO_AND_CONST_SS_H -#define INCLUDED_GPIO_AND_CONST_SS_H - -#include <gr_sync_block.h> - -class gpio_and_const_ss; -typedef boost::shared_ptr<gpio_and_const_ss> gpio_and_const_ss_sptr; - -gpio_and_const_ss_sptr gpio_make_and_const_ss (unsigned short k); - -/*! - * \brief output = input & constant - * \ingroup block - */ -class gpio_and_const_ss : public gr_sync_block -{ - friend gpio_and_const_ss_sptr gpio_make_and_const_ss (unsigned short k); - - unsigned short d_k; // the constant - gpio_and_const_ss (unsigned short k); - - public: - unsigned short k () const { return d_k; } - void set_k (unsigned short k) { d_k = k; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gr-gpio/src/python/Makefile.am b/gr-gpio/src/python/Makefile.am index b61a40805..ee5bdaadd 100644 --- a/gr-gpio/src/python/Makefile.am +++ b/gr-gpio/src/python/Makefile.am @@ -36,15 +36,4 @@ dist_bin_SCRIPTS = \ gpio_usrp_siggen.py \ gpio_usrp_fft.py -# List of python files that will get distributed in tarball -# but not installed anywhere on system -noinst_PYTHON = \ - qa_gpio.py - -# Programs that get run by 'make check' -TESTS = run_tests - -# Files to go into tarball not otherwise mentioned -EXTRA_DIST = run_tests.in - MOSTLYCLEANFILES = *.pyo *.pyc *~ diff --git a/gr-gpio/src/python/gpio_rx_sfile.py b/gr-gpio/src/python/gpio_rx_sfile.py index ac4d608bf..31f598ef7 100755 --- a/gr-gpio/src/python/gpio_rx_sfile.py +++ b/gr-gpio/src/python/gpio_rx_sfile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -79,8 +79,8 @@ class my_top_block(gr.top_block): self.connect(u, head) src = head - ana_strip = gpio.and_const_ss(0xFFFE) - dig_strip = gpio.and_const_ss(0x0001) + ana_strip = gr.and_const_ss(0xFFFE) + dig_strip = gr.and_const_ss(0x0001) ana_sink = gr.file_sink(gr.sizeof_short, options.ana_filename) dig_sink = gr.file_sink(gr.sizeof_short, options.dig_filename) diff --git a/gr-gpio/src/python/gpio_usrp_fft.py b/gr-gpio/src/python/gpio_usrp_fft.py index cde0de05a..40b1c54d4 100755 --- a/gr-gpio/src/python/gpio_usrp_fft.py +++ b/gr-gpio/src/python/gpio_usrp_fft.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -144,10 +144,10 @@ class app_top_block(stdgui2.std_top_block): thr = gr.throttle(gr.sizeof_short, input_rate) self.connect(self.filesrc,thr,self.is2c,self.scope) elif options.digital: - self.select_dig=gpio.and_const_ss(0x0001) + self.select_dig=gr.and_const_ss(0x0001) self.connect(self.u, self.select_dig,self.is2c,self.scope) elif options.analog: - self.select_ana=gpio.and_const_ss(0xFFFE) + self.select_ana=gr.and_const_ss(0xFFFE) self.connect(self.u, self.select_ana,self.is2c,self.scope) else: self.connect(self.u,self.is2c,self.scope) diff --git a/gr-gpio/src/python/qa_gpio.py b/gr-gpio/src/python/qa_gpio.py deleted file mode 100755 index 1d140c248..000000000 --- a/gr-gpio/src/python/qa_gpio.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2008 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. -# - -from gnuradio import gr, gr_unittest -# This is different from the usage after installation -import gpio_swig - -class qa_gpio (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block() - - def tearDown (self): - self.tb = None - -if __name__ == '__main__': - gr_unittest.main () diff --git a/gr-gpio/src/python/run_tests.in b/gr-gpio/src/python/run_tests.in deleted file mode 100644 index 999e4634c..000000000 --- a/gr-gpio/src/python/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-gpio \ - @abs_top_builddir@/gr-gpio \ - @srcdir@ |