From 08fa55c5851d0fa6b4f9c2ecd0b7b63bbd164f6d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 16 Jul 2020 19:07:58 +0200 Subject: [PATCH] Add missing includes, use \n instead of endl --- .../signal_source/libs/fpga_dynamic_bit_selection.cc | 12 +++++++----- .../signal_source/libs/fpga_dynamic_bit_selection.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.cc b/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.cc index 17ade43d9..d9b8bb6ab 100644 --- a/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.cc +++ b/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.cc @@ -25,7 +25,7 @@ #include "fpga_dynamic_bit_selection.h" #include #include // for open, O_RDWR, O_SYNC -#include // for cout, endl +#include // for cout #include // for mmap Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(const std::string &device_name1, const std::string &device_name2) @@ -41,7 +41,7 @@ Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(const std::string &device if (d_map_base1 == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA dynamic bit selection module in frequency band 1 into tracking memory"; - std::cout << "Could not map dynamic bit selection memory corresponding to frequency band 1." << std::endl; + std::cout << "Could not map dynamic bit selection memory corresponding to frequency band 1.\n"; } // dynamic bits selection corresponding to frequency band 2 @@ -55,7 +55,7 @@ Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(const std::string &device if (d_map_base2 == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA dynamic bit selection module in frequency band 2 into tracking memory"; - std::cout << "Could not map dynamic bit selection memory corresponding to frequency band 2." << std::endl; + std::cout << "Could not map dynamic bit selection memory corresponding to frequency band 2.\n"; } // initialize default bit selection @@ -71,6 +71,7 @@ Fpga_dynamic_bit_selection::~Fpga_dynamic_bit_selection() close_devices(); } + void Fpga_dynamic_bit_selection::bit_selection(void) { // estimated signal power corresponding to frequency band 1 @@ -117,18 +118,19 @@ void Fpga_dynamic_bit_selection::bit_selection(void) d_map_base2[0] = shift_out_bits_band2; } + void Fpga_dynamic_bit_selection::close_devices() { auto *aux = const_cast(d_map_base1); if (munmap(static_cast(aux), FPGA_PAGE_SIZE) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } aux = const_cast(d_map_base2); if (munmap(static_cast(aux), FPGA_PAGE_SIZE) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } close(d_device_descriptor1); diff --git a/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.h b/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.h index 4e6061143..b2e8073d2 100644 --- a/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.h +++ b/src/algorithms/signal_source/libs/fpga_dynamic_bit_selection.h @@ -25,6 +25,8 @@ #ifndef GNSS_SDR_FPGA_DYNAMIC_BIT_SELECTION_H #define GNSS_SDR_FPGA_DYNAMIC_BIT_SELECTION_H +#include +#include #include /*! @@ -63,13 +65,11 @@ private: static const uint32_t Power_Threshold_High = 15000; static const uint32_t Power_Threshold_Low = 6000; - void close_devices(void); uint32_t shift_out_bits_band1; // number of bits to shift for frequency band 1 uint32_t shift_out_bits_band2; // number of bits to shift for frequency band 2 - volatile unsigned* d_map_base1; // driver memory map corresponding to frequency band 1 int d_device_descriptor1; // driver descriptor corresponding to frequency band 1