diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index e5c726ec5..3b9bda966 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -84,16 +84,16 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( { case 1: // INAV { - d_PRN_code_period_ms = static_cast(GALILEO_E1_CODE_PERIOD_MS); // for Galileo E5b is also 4 ms + d_PRN_code_period_ms = GALILEO_E1_CODE_PERIOD_MS; // for Galileo E5b is also 4 ms d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS; // set the preamble d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_preamble_period_symbols = GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS; - d_required_symbols = static_cast(GALILEO_INAV_PAGE_SYMBOLS) + d_samples_per_preamble; + d_required_symbols = GALILEO_INAV_PAGE_SYMBOLS + d_samples_per_preamble; // preamble bits to sampled symbols d_preamble_samples.reserve(d_samples_per_preamble); d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; - d_codelength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; + d_codelength = static_cast(d_frame_length_symbols); d_datalength = (d_codelength / d_nn) - d_mm; d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm @@ -110,21 +110,21 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( // preamble bits to sampled symbols d_preamble_samples.reserve(d_samples_per_preamble); d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; - d_codelength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; + d_codelength = static_cast(d_frame_length_symbols); d_datalength = (d_codelength / d_nn) - d_mm; d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm break; } case 3: // CNAV { - d_PRN_code_period_ms = static_cast(GALILEO_E6_CODE_PERIOD_MS); + d_PRN_code_period_ms = GALILEO_E6_CODE_PERIOD_MS; d_bits_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_samples_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_preamble_period_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE; d_required_symbols = static_cast(GALILEO_CNAV_SYMBOLS_PER_PAGE) + d_samples_per_preamble; d_preamble_samples.reserve(d_samples_per_preamble); d_frame_length_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE - GALILEO_CNAV_PREAMBLE_LENGTH_BITS; - d_codelength = GALILEO_CNAV_SYMBOLS_PER_PAGE - GALILEO_CNAV_PREAMBLE_LENGTH_BITS; + d_codelength = static_cast(d_frame_length_symbols); d_datalength = (d_codelength / d_nn) - d_mm; d_max_symbols_without_valid_frame = GALILEO_CNAV_SYMBOLS_PER_PAGE * 60; break; @@ -804,7 +804,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( else { // this page has no timing information - d_TOW_at_current_symbol_ms += static_cast(d_PRN_code_period_ms); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD_S; + d_TOW_at_current_symbol_ms += d_PRN_code_period_ms; } } break; diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 3adb6ab93..84bfad033 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -41,7 +41,7 @@ constexpr double GALILEO_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 su constexpr double GALILEO_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] constexpr double GALILEO_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] constexpr double GALILEO_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] -constexpr int32_t GALILEO_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] +constexpr uint32_t GALILEO_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] constexpr int32_t GALILEO_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS constexpr int32_t GALILEO_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] constexpr int32_t GALILEO_E1_NUMBER_OF_CODES = 50; diff --git a/src/core/system_parameters/Galileo_E6.h b/src/core/system_parameters/Galileo_E6.h index 98d7c59c7..22281ed39 100644 --- a/src/core/system_parameters/Galileo_E6.h +++ b/src/core/system_parameters/Galileo_E6.h @@ -38,7 +38,7 @@ constexpr double GALILEO_E6_CODE_PERIOD_S = 0.001; //!< Galileo E6 cod constexpr double GALILEO_E6_B_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 B code length [chips] constexpr double GALILEO_E6_C_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 C code length [chips] constexpr double GALILEO_E6_C_SECONDARY_CODE_LENGTH_CHIPS = 100.0; //!< Galileo E6 C secondary code length [chips] -constexpr int32_t GALILEO_E6_CODE_PERIOD_MS = 1; //!< Galileo E& B/C code period [ms] +constexpr uint32_t GALILEO_E6_CODE_PERIOD_MS = 1; //!< Galileo E& B/C code period [ms] constexpr int32_t GALILEO_E6_NUMBER_OF_CODES = 50;