summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-17 19:54:31 +0100
committerJosh Blum <josh@joshknows.com>2011-06-17 19:56:05 +0100
commit5769c72d03f256f5802057d047a003b310cc6ba2 (patch)
tree46358c4cf4b5f173d18794061ac5c4c8dbf57c21
parente0af09e96509ee091ca94cbe64dd818a4a221fdd (diff)
downloaduhd-5769c72d03f256f5802057d047a003b310cc6ba2.tar.gz
uhd-5769c72d03f256f5802057d047a003b310cc6ba2.tar.bz2
uhd-5769c72d03f256f5802057d047a003b310cc6ba2.zip
e100: wrong gpio, its 147 for interrupt
-rw-r--r--host/lib/usrp/e100/io_impl.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp
index a8d3ad015..65fb1f3db 100644
--- a/host/lib/usrp/e100/io_impl.cpp
+++ b/host/lib/usrp/e100/io_impl.cpp
@@ -104,16 +104,16 @@ struct e100_impl::io_impl{
void recv_pirate_loop(
boost::barrier &spawn_barrier,
const boost::function<void(void)> &handle,
- e100_iface::sptr //keep a sptr to iface which shares gpio145
+ e100_iface::sptr //keep a sptr to iface which shares gpio147
){
spawn_barrier.wait();
- UHD_LOG << "pirate loop spawned" << std::endl;
//open the GPIO and set it up for an IRQ
- std::ofstream edge_file("/sys/class/gpio/gpio145/edge");
+ std::ofstream edge_file("/sys/class/gpio/gpio147/edge");
edge_file << "rising" << std::endl << std::flush;
edge_file.close();
- int fd = ::open("/sys/class/gpio/gpio145/value", O_RDONLY);
+ int fd = ::open("/sys/class/gpio/gpio147/value", O_RDONLY);
+ if (fd < 0) UHD_MSG(error) << "Unable to open GPIO for IRQ\n";
while (not boost::this_thread::interruption_requested()){
pollfd pfd;
@@ -123,9 +123,8 @@ struct e100_impl::io_impl{
if (ret > 0) handle();
}
+ //cleanup before thread exit
::close(fd);
-
- UHD_LOG << "pirate loop done" << std::endl;
}
bounded_buffer<async_metadata_t> async_msg_fifo;
boost::thread_group recv_pirate_crew;