discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] FreeBSD patches for gnuradio


From: Diane Bruce
Subject: Re: [Discuss-gnuradio] FreeBSD patches for gnuradio
Date: Wed, 23 May 2007 11:04:55 -0400
User-agent: Mutt/1.4.2.2i

Hi,

On Wed, May 23, 2007 at 09:06:17AM -0400, Greg Troxel wrote:
> Is the gr-radio-astronomy patch a FreeBSD fix, or generic?

Somehow the original comments that were supposed to be attached
got dropped, they follow here.

Hi,

I have some diffs for gnuradio on FreeBSD. It runs fine.
I also have a gnuradio port for FreeBSD waiting to be committed, if
you know anyone that needs it, they can contact me.

diffs attached.

These three diffs add detection of parallel port code on FreeBSD
and add parallel bus support to ppdev.cc

patch-config.h.in
patch-configure.ac
patch-gnuradio-core_src_lib_io_ppio_ppdev.cc

I might have other diffs that might be useful for portability.

You probably have already fixed this one. I will have to check svn

patch-gr-radio-astronomy_src_python_usr_psr_receiver.py
-        self.audiodev = options.audio_dev
+        self.audiodev = options.audio_source

----

The astronomy patches are generic,
And, yes I see it has been already fixed in svn.
http://gnuradio.org/trac/browser/gnuradio/trunk/gr-radio-astronomy/src/python/usrp_psr_receiver.py
 line 98.

So, that diff may be safely ignored.

>
> ppdev.c:
>
> I don't see why the include of sstream is conditional on the various pp
> methods.

You could move it as simply:

-#ifdef HAVE_LINUX_PPDEV_H
+#if defined(HAVE_LINUX_PPDEV_H)
 #include <sys/ioctl.h>
 #include <linux/ppdev.h>
 #include <linux/parport.h>
-#include <sstream>
+#elif defined(HAVE_DEV_PPBUS_PPI_H)
+#include <sys/ioctl.h>
+#include <dev/ppbus/ppi.h>
+#include <dev/ppbus/ppbconf.h>
 #else
 // #warn "ppio_ppdev is not functional on this platform"
 #endif

+#include <sstream>

However, then the original code did not include sstream when no pp
method was found. It's up to you guys if you want to always include
sstream even when a pp method is not found.

>
> The diff seems to add code for Linux as well, but I wonder if that's an
> artifact of how diff chose to deal with before/after.

That is an artefact.

>
> Other than that question and nits, at first glance this looks fine, but

I would point out, that there are very little changes.

void
ppio_ppdev::write_control (unsigned char v)
{
  unsigned char ctrl = v ^ CP_ACTIVE_LOW_BITS;
  if (ioctl (d_fd, PPWCONTROL, &ctrl) != 0){
    perror ("ppio_ppdev: PPWCONTROL");
    throw std::runtime_error ("PPWCONTROL");
  }
}


void
ppio_ppdev::write_control (unsigned char v)
{
  unsigned char ctrl = v ^ CP_ACTIVE_LOW_BITS;
  if (ioctl (d_fd, PPISCTRL, &ctrl) != 0){
    perror ("ppio_ppdev: PPISCTRL");
    throw std::runtime_error ("PPISCTRL");
  }
}

One could do something like (not tested):

#elif defined(HAVE_DEV_PPBUS_PPI_H)
#include <sys/ioctl.h>
#include <dev/ppbus/ppi.h>
#include <dev/ppbus/ppbconf.h>
#define PPWCONTROL PPISCTR
#else
...
and
...
void
ppio_ppdev::write_control (unsigned char v)
{
  unsigned char ctrl = v ^ CP_ACTIVE_LOW_BITS;
  if (ioctl (d_fd, PPISCTRL, &ctrl) != 0){
    perror ("ppio_ppdev: write_control");
    throw std::runtime_error ("write_control");
  }
}

Noting that ppio_ppdev::ppio_ppdev (int which)

would need a conditional still around the IEEE1284_MODE_COMPAT

Note I wanted the error messages to bear some relationship with reality.

> you're probably over that pesky copyright assignment threshold...

I'll look into it today.

>
>

- Diane

--
- address@hidden address@hidden http://www.db.net/~db




reply via email to

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