1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-17 23:34:56 +00:00

fix code for 32-bit processor architecture

This commit is contained in:
Marc Majoral 2022-04-29 12:16:48 +02:00
parent d346e763f8
commit 916b12eef6
3 changed files with 5 additions and 9 deletions

View File

@ -23,9 +23,7 @@
#include "concurrent_queue.h" #include "concurrent_queue.h"
#include "fpga_buffer_monitor.h" #include "fpga_buffer_monitor.h"
#if INTPTR_MAX == INT64_MAX // 64-bit processor architecture
#include "fpga_dma.h" #include "fpga_dma.h"
#endif
#include "fpga_dynamic_bit_selection.h" #include "fpga_dynamic_bit_selection.h"
#include "fpga_switch.h" #include "fpga_switch.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
@ -108,10 +106,7 @@ private:
std::shared_ptr<Fpga_Switch> switch_fpga; std::shared_ptr<Fpga_Switch> switch_fpga;
std::shared_ptr<Fpga_dynamic_bit_selection> dynamic_bit_selection_fpga; std::shared_ptr<Fpga_dynamic_bit_selection> dynamic_bit_selection_fpga;
std::shared_ptr<Fpga_buffer_monitor> buffer_monitor_fpga; std::shared_ptr<Fpga_buffer_monitor> buffer_monitor_fpga;
#if INTPTR_MAX == INT64_MAX // 64-bit processor architecture
std::shared_ptr<Fpga_DMA> dma_fpga; std::shared_ptr<Fpga_DMA> dma_fpga;
#endif
std::mutex dma_mutex; std::mutex dma_mutex;
std::mutex dynamic_bit_selection_mutex; std::mutex dynamic_bit_selection_mutex;

View File

@ -108,10 +108,10 @@ int Fpga_DMA::DMA_write(int nbytes)
#else // 32-bit processor architecture #else // 32-bit processor architecture
const int num_bytes_sent = write(tx_fd, dma_buffer, nread_elements * 2); const int num_bytes_sent = write(tx_fd, buffer.data(), nbytes);
if (num_bytes_sent != num_transferred_bytes) if (num_bytes_sent != nbytes)
{ {
return -1 return -1;
} }
#endif #endif

View File

@ -79,6 +79,7 @@ public:
* \brief Obtain DMA buffer address. * \brief Obtain DMA buffer address.
*/ */
std::array<int8_t, BUFFER_SIZE> *get_buffer_address(void); std::array<int8_t, BUFFER_SIZE> *get_buffer_address(void);
/*! /*!
* \brief Transfer DMA data * \brief Transfer DMA data
*/ */
@ -93,7 +94,7 @@ private:
#if INTPTR_MAX == INT64_MAX // 64-bit processor architecture #if INTPTR_MAX == INT64_MAX // 64-bit processor architecture
channel tx_channel; channel tx_channel;
#else // 32-bit processor architecture #else // 32-bit processor architecture
std::array<int8_t, BUFFER_SIZE> buffer[BUFFER_SIZE]; std::array<int8_t, BUFFER_SIZE> buffer;
int tx_fd; int tx_fd;
#endif #endif
}; };