From bf3f66278ffa541ab2e3395986d74dfd2a39aaa7 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Mon, 15 Apr 2019 16:30:35 +0200 Subject: [PATCH] closed the acquisition device driver in the proper way + updated fpga block expponent. --- .../galileo_e1_pcps_ambiguous_acquisition_fpga.cc | 4 ++-- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 1 + src/algorithms/acquisition/libs/fpga_acquisition.cc | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index e153aff18..e7a45bfe7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -180,14 +180,14 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters.max_num_acqs = configuration_->property(role + ".max_num_acqs", 2); // reference for the FPGA FFT-IFFT attenuation factor - acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 12); + acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 13); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + // temporary buffers that we can delete delete[] code; delete fft_if; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 421652353..99de2d8ed 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -302,6 +302,7 @@ void pcps_acquisition_fpga::set_active(bool active) } num_second_acq = num_second_acq + 1; } + acquisition_fpga->close_device(); if (d_test_statistics <= d_threshold) { d_state = 0; diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index ed2096d70..822e02d3c 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -177,7 +177,7 @@ void Fpga_Acquisition::run_acquisition(void) { // enable interrupts int32_t reenable = 1; - int32_t disable_int = 0; + //int32_t disable_int = 0; ssize_t nbytes = TEMP_FAILURE_RETRY(write(d_fd, reinterpret_cast(&reenable), sizeof(int32_t))); if (nbytes != sizeof(int32_t)) { @@ -197,11 +197,11 @@ void Fpga_Acquisition::run_acquisition(void) std::cout << "acquisition module Interrupt number " << irq_count << std::endl; } - nbytes = TEMP_FAILURE_RETRY(write(d_fd, reinterpret_cast(&disable_int), sizeof(int32_t))); - if (nbytes != sizeof(int32_t)) - { - std::cerr << "Error disabling interruptions in the FPGA." << std::endl; - } + // nbytes = TEMP_FAILURE_RETRY(write(d_fd, reinterpret_cast(&disable_int), sizeof(int32_t))); + // if (nbytes != sizeof(int32_t)) + // { + // std::cerr << "Error disabling interruptions in the FPGA." << std::endl; + // } }