1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 06:23:18 +00:00

Do not warn users twice about the overflow

clang-tidy checks applied: modernize-redundant-void-arg, performance-unnecessary-value-param
This commit is contained in:
Carles Fernandez 2021-02-18 13:17:46 +01:00
parent 29e3e120be
commit 8e23c60fca
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 8 additions and 9 deletions

View File

@ -32,12 +32,14 @@
#include <fstream> // for string, ofstream
#include <iostream> // for cout
#include <sys/mman.h> // for mmap
#include <utility> // for move
Fpga_buffer_monitor::Fpga_buffer_monitor(const std::string &device_name, uint32_t num_freq_bands, bool dump, std::string dump_filename)
{
d_num_freq_bands = num_freq_bands;
d_dump = dump;
d_dump_filename = dump_filename;
d_dump_filename = std::move(dump_filename);
// open device descriptor
if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1)
@ -144,7 +146,7 @@ Fpga_buffer_monitor::~Fpga_buffer_monitor()
}
void Fpga_buffer_monitor::check_buffer_overflow_and_monitor_buffer_status(void)
void Fpga_buffer_monitor::check_buffer_overflow_and_monitor_buffer_status()
{
// check buffer overflow flags
uint32_t buffer_overflow_status = d_map_base[overflow_flags_reg_addr];
@ -153,12 +155,10 @@ void Fpga_buffer_monitor::check_buffer_overflow_and_monitor_buffer_status(void)
{
if (d_num_freq_bands > 1)
{
std::cout << "FPGA Buffer overflow in frequency band 0" << std::endl;
LOG(ERROR) << "FPGA Buffer overflow in frequency band 0";
}
else
{
std::cout << "FPGA Buffer overflow" << std::endl;
LOG(ERROR) << "FPGA Buffer overflow";
}
}
@ -167,7 +167,6 @@ void Fpga_buffer_monitor::check_buffer_overflow_and_monitor_buffer_status(void)
{
if ((buffer_overflow_status & overflow_freq_band_1_bit_pos) != 0)
{
std::cout << "FPGA Buffer overflow in frequency band 1" << std::endl;
LOG(ERROR) << "FPGA Buffer overflow in frequency band 1";
}
}
@ -232,7 +231,7 @@ void Fpga_buffer_monitor::check_buffer_overflow_and_monitor_buffer_status(void)
}
int32_t Fpga_buffer_monitor::buffer_monitor_test_register(void)
int32_t Fpga_buffer_monitor::buffer_monitor_test_register()
{
// write value to test register
d_map_base[test_reg_addr] = test_register_writeval;

View File

@ -59,7 +59,7 @@ public:
/*!
* \brief This function checks buffer overflow and monitors the FPGA buffer status
*/
void check_buffer_overflow_and_monitor_buffer_status(void);
void check_buffer_overflow_and_monitor_buffer_status();
private:
static const size_t FPGA_PAGE_SIZE = 0x10000;
@ -79,8 +79,8 @@ private:
static const uint32_t overflow_freq_band_0_bit_pos = 1;
static const uint32_t overflow_freq_band_1_bit_pos = 2;
int32_t buffer_monitor_test_register(void);
void close_device(void);
int32_t buffer_monitor_test_register();
void close_device();
volatile unsigned* d_map_base; // driver memory map corresponding to the FPGA buffer monitor
int d_device_descriptor; // driver descriptor corresponding to the FPGA buffer monitor