From 9ff4d8d88024de3082e0a2d17b02877f7c508a0f Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 15 Nov 2017 10:22:40 +0100 Subject: [PATCH] Fix Galileo E5a deadlock --- .../galileo_e5a_noncoherent_iq_acquisition_caf.cc | 2 +- .../galileo_e5a_noncoherent_iq_acquisition_caf.h | 1 - .../galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc | 12 ++++++------ .../galileo_e5a_dll_pll_tracking_cc.cc | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index ec9501b12..afc50d17c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -84,7 +84,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); //--- Find number of samples per spreading code (1ms)------------------------- - code_length_ = round(fs_in_ / Galileo_E5a_CODE_CHIP_RATE_HZ * Galileo_E5a_CODE_LENGTH_CHIPS); + code_length_ = round(static_cast(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * sampled_ms_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index ce23d5441..60fc3c577 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -135,7 +135,6 @@ public: private: ConfigurationInterface* configuration_; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_; - gr::blocks::stream_to_vector::sptr stream_to_vector_; size_t item_size_; std::string item_type_; unsigned int vector_length_; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index f20d39ff0..858a4117d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -344,7 +344,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state) -int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items, +int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) { @@ -392,17 +392,17 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items { const gr_complex *in = reinterpret_cast(input_items[0]); //Get the input samples pointer unsigned int buff_increment; - if (ninput_items[0] + d_buffer_count <= d_fft_size) + if ((ninput_items[0] + d_buffer_count) <= d_fft_size) { buff_increment = ninput_items[0]; } else { - buff_increment = (d_fft_size - d_buffer_count); + buff_increment = d_fft_size - d_buffer_count; } memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * buff_increment); // If buffer will be full in next iteration - if (d_buffer_count >= d_fft_size - d_gr_stream_buffer) + if (d_buffer_count >= (d_fft_size - d_gr_stream_buffer)) { d_state = 2; } @@ -419,7 +419,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items { memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex)*(d_fft_size-d_buffer_count)); } - d_sample_counter += d_fft_size-d_buffer_count; // sample counter + d_sample_counter += (d_fft_size - d_buffer_count); // sample counter // initialize acquisition algorithm int doppler; @@ -810,6 +810,6 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items } } - return noutput_items; + return 0; } diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc index 45beca2bf..74446bf96 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc @@ -430,6 +430,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute current_synchro_data.Carrier_phase_rads = 0.0; current_synchro_data.CN0_dB_hz = 0.0; current_synchro_data.fs = d_fs_in; + *out[0] = current_synchro_data; consume_each(samples_offset); //shift input to perform alignment with local replica return 1; break;