1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-24 05:53:16 +00:00

Remove unused includes, minor fixes

This commit is contained in:
Carles Fernandez 2018-05-01 12:02:50 +02:00
parent f259ef28dd
commit 8d8ebfc6df
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 41 additions and 46 deletions

View File

@ -29,7 +29,7 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.")
endif(NOT IIO_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
@ -38,12 +38,12 @@ endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
if(ENABLE_AD9361)
find_package(libiio REQUIRED)
if(NOT LIBIIO_FOUND)
message(STATUS "gnuradio-iio not found, its installation is required.")
message(STATUS "libiio not found, its installation is required.")
message(STATUS "Please build and install the following projects:")
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.")
endif(NOT LIBIIO_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})

View File

@ -35,10 +35,8 @@
#include "ad9361_manager.h"
#include "GPS_L1_CA.h"
#include "GPS_L2C.h"
#include <signal.h>
#include <stdio.h>
#include <glog/logging.h>
#include <iostream>
#include <iostream> // for cout, endl
#ifdef __APPLE__
#include <iio/iio.h>
@ -47,10 +45,8 @@
#endif
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_stream_(in_stream), out_stream_(out_stream),
queue_(queue)
std::string role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";
@ -75,12 +71,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
enable_dds_lo_=configuration->property(role + ".enable_dds_lo", false);
freq_rf_tx_hz_=configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ-GPS_L2_FREQ_HZ-1000);
freq_dds_tx_hz_=configuration->property(role + ".freq_dds_tx_hz", 1000);
scale_dds_dbfs_=configuration->property(role + ".scale_dds_dbfs", -3.0);
phase_dds_deg_=configuration->property(role + ".phase_dds_deg", 0.0);
tx_attenuation_db_=configuration->property(role + ".tx_attenuation_db", 0.0);
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000);
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000);
scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", -3.0);
phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0);
tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", 0.0);
item_size_ = sizeof(gr_complex);
@ -89,30 +85,30 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
config_ad9361_rx_local(bandwidth_,
sample_rate_,
freq_,
rf_port_select_,
gain_mode_rx1_,
gain_mode_rx2_,
rf_gain_rx1_,
rf_gain_rx2_);
sample_rate_,
freq_,
rf_port_select_,
gain_mode_rx1_,
gain_mode_rx2_,
rf_gain_rx1_,
rf_gain_rx2_);
//LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION
if (enable_dds_lo_==true)
{
config_ad9361_lo_local(bandwidth_,
sample_rate_,
freq_rf_tx_hz_,
tx_attenuation_db_,
freq_dds_tx_hz_,
scale_dds_dbfs_);
}
if (enable_dds_lo_ == true)
{
config_ad9361_lo_local(bandwidth_,
sample_rate_,
freq_rf_tx_hz_,
tx_attenuation_db_,
freq_dds_tx_hz_,
scale_dds_dbfs_);
}
// turn switch to A/D position
std::string default_device_name = "/dev/uio13";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
int switch_position = configuration->property(role + ".switch_position", 0);
switch_fpga = std::make_shared <fpga_switch>(device_name);
switch_fpga = std::make_shared<fpga_switch>(device_name);
switch_fpga->set_switch_position(switch_position);
}
@ -125,11 +121,11 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource()
//if (rx0_q) { iio_channel_disable(rx0_q); }
if (enable_dds_lo_)
{
ad9361_disable_lo_local();
}
{
ad9361_disable_lo_local();
}
// std::cout<<"* AD9361 Destroying context\n";
// std::cout<<"* AD9361 Destroying context\n";
//if (ctx) { iio_context_destroy(ctx); }
}

View File

@ -34,21 +34,20 @@
#include "gnss_block_interface.h"
#include "fpga_switch.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/msg_queue.h>
#include <string>
class ConfigurationInterface;
class Ad9361FpgaSignalSource: public GNSSBlockInterface
class Ad9361FpgaSignalSource : public GNSSBlockInterface
{
public:
Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
virtual ~Ad9361FpgaSignalSource();
~Ad9361FpgaSignalSource();
inline std::string role() override
{
@ -77,11 +76,11 @@ private:
std::string role_;
// Front-end settings
std::string uri_;//device direction
unsigned long freq_; //frequency of local oscilator
std::string uri_; // device direction
unsigned long freq_; // frequency of local oscillator
unsigned long sample_rate_;
unsigned long bandwidth_;
unsigned long buffer_size_; //reception buffer
unsigned long buffer_size_; // reception buffer
bool rx1_en_;
bool rx2_en_;
bool quadrature_;
@ -95,7 +94,7 @@ private:
std::string filter_file_;
bool filter_auto_;
//DDS configuration for LO generation for external mixer
// DDS configuration for LO generation for external mixer
bool enable_dds_lo_;
unsigned long freq_rf_tx_hz_;
unsigned long freq_dds_tx_hz_;