From a797bfb641635955cb68945a29386ae43e088ca0 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Mon, 12 Mar 2018 11:27:26 +0100 Subject: [PATCH] Migrate GPS L1 TOW from double to unsigned int --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 8 ++++---- src/core/system_parameters/GPS_L1_CA.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 2ace76e77..580bc8bdc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -362,12 +362,12 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ else { d_TOW_at_current_symbol += GPS_L1_CA_CODE_PERIOD; - d_TOW_at_current_symbol_ms++; + d_TOW_at_current_symbol_ms += GPS_L1_CA_CODE_PERIOD_MS; } - current_symbol.TOW_at_current_symbol_s = static_cast(d_TOW_at_current_symbol_ms) / 1000.0; - //current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol; - current_symbol.Flag_valid_word = flag_TOW_set; + current_symbol.TOW_at_current_symbol_s = static_cast(d_TOW_at_current_symbol_ms) / 1000.0; + //current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol; + current_symbol.Flag_valid_word = flag_TOW_set; if (flag_PLL_180_deg_phase_locked == true) { diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index cf2611344..c5ae95618 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -53,6 +53,7 @@ const double GPS_L1_FREQ_HZ = FREQ1; //!< L1 [Hz] const double GPS_L1_CA_CODE_RATE_HZ = 1.023e6; //!< GPS L1 C/A code rate [chips/s] const double GPS_L1_CA_CODE_LENGTH_CHIPS = 1023.0; //!< GPS L1 C/A code length [chips] const double GPS_L1_CA_CODE_PERIOD = 0.001; //!< GPS L1 C/A code period [seconds] +const unsigned int GPS_L1_CA_CODE_PERIOD_MS = 1; //!< GPS L1 C/A code period [ms] const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds] /*!