Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils/buffer_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void Buffer::getSamples(std::vector<unsigned short> &data, unsigned int nb_sampl
}
struct iio_block *block = m_rx_blocks[m_rx_head];
int ret = iio_block_dequeue(block, false);
if (ret) {
if (ret < 0) {
destroy();
THROW_M2K_EXCEPTION("Buffer: Cannot dequeue RX block", libm2k::EXC_RUNTIME_ERROR, ret);
return;
Expand Down Expand Up @@ -369,7 +369,7 @@ const unsigned short* Buffer::getSamplesP(unsigned int nb_samples)
}
struct iio_block *block = m_rx_blocks[m_rx_head];
int ret = iio_block_dequeue(block, false);
if (ret) {
if (ret < 0) {
destroy();
THROW_M2K_EXCEPTION("Buffer: Cannot dequeue RX block", libm2k::EXC_RUNTIME_ERROR, ret);
return nullptr;
Expand Down Expand Up @@ -454,7 +454,7 @@ void* Buffer::getSamplesRawInterleavedVoid(unsigned int nb_samples)
}
struct iio_block *block = m_rx_blocks[m_rx_head];
int ret = iio_block_dequeue(block, false);
if (ret) {
if (ret < 0) {
destroy();
THROW_M2K_EXCEPTION("Buffer: Cannot dequeue RX block", libm2k::EXC_RUNTIME_ERROR, ret);
return nullptr;
Expand Down
Loading