diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 76adfc28c..f89c73541 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -683,8 +683,11 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), gr::thread::scoped_lock lk(d_setlock); if (!d_active or d_worker_active) { - d_sample_counter += d_fft_size * ninput_items[0]; - consume_each(ninput_items[0]); + if (!acq_parameters.blocking_on_stanby) + { + d_sample_counter += d_fft_size * ninput_items[0]; + consume_each(ninput_items[0]); + } if (d_step_two) { d_doppler_center_step_two = static_cast(d_gnss_synchro->Acq_doppler_hz); @@ -708,8 +711,11 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), d_input_power = 0.0; d_test_statistics = 0.0; d_state = 1; - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); + if (!acq_parameters.blocking_on_stanby) + { + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + } break; } diff --git a/src/algorithms/acquisition/libs/acq_conf.cc b/src/algorithms/acquisition/libs/acq_conf.cc index f44f7a15f..996880408 100644 --- a/src/algorithms/acquisition/libs/acq_conf.cc +++ b/src/algorithms/acquisition/libs/acq_conf.cc @@ -50,4 +50,5 @@ Acq_Conf::Acq_Conf() dump_filename = ""; dump_channel = 0; it_size = sizeof(char); + blocking_on_stanby = false; } diff --git a/src/algorithms/acquisition/libs/acq_conf.h b/src/algorithms/acquisition/libs/acq_conf.h index 7abcb2e98..bb939a652 100644 --- a/src/algorithms/acquisition/libs/acq_conf.h +++ b/src/algorithms/acquisition/libs/acq_conf.h @@ -51,6 +51,7 @@ public: bool use_CFAR_algorithm_flag; bool dump; bool blocking; + bool blocking_on_stanby; //enable it only for unit testing to avoid sample consume on idle status bool make_2_steps; std::string dump_filename; unsigned int dump_channel;