1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-08-05 21:33:47 +00:00

Apply code formatting

This commit is contained in:
Carles Fernandez 2018-04-30 20:15:00 +02:00
parent bd81330201
commit faf27fff22
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 61 additions and 62 deletions

View File

@ -33,15 +33,17 @@
*
* -------------------------------------------------------------------------
*/
#include <new>
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gps_l1_ca_pcps_acquisition_fpga.h"
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h"
#include <gnuradio/fft/fft.h>
#include <volk/volk.h>
#include <glog/logging.h>
#include "gps_l1_ca_pcps_acquisition_fpga.h"
#include "configuration_interface.h"
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h"
#include "gnss_sdr_flags.h"
#include <new>
#define NUM_PRNs 32
@ -70,10 +72,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
// The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float) code_length));
float nbits = ceilf(log2f((float)code_length));
unsigned int nsamples_total = pow(2, nbits);
unsigned int vector_length = nsamples_total * sampled_ms;
unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0);
unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
std::string device_name = configuration_->property(role + ".devicename", default_device_name);
@ -95,7 +97,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
{
gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code
// fill in zero padding
for (int s=code_length;s<nsamples_total;s++)
for (int s = code_length; s < nsamples_total; s++)
{
code[s] = 0;
}
@ -117,9 +119,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
}
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
{
d_all_fft_codes_[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
}
}

View File

@ -37,11 +37,10 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_
#include <string>
#include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h"
#include <string>
class ConfigurationInterface;
@ -144,8 +143,7 @@ private:
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
lv_16sc_t *d_all_fft_codes_; // memory that contains all the code ffts
lv_16sc_t* d_all_fft_codes_; // memory that contains all the code ffts
};
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ */