Skip to content

Commit

Permalink
dmm: use kernel buffers when using dmm
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Suciu <adrian.suciu@analog.com>
  • Loading branch information
adisuciu authored and AlexandraTrifan committed Mar 11, 2022
1 parent 3ca878e commit 1e862f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ void DMM::toggleTimer(bool start)
{
enableDataLogging(start);
if (start) {
manager->set_kernel_buffer_count(4);
writeAllSettingsToHardware();
manager->start(id_ch1);
manager->start(id_ch2);
Expand All @@ -529,6 +530,7 @@ void DMM::toggleTimer(bool start)

manager->stop(id_ch1);
manager->stop(id_ch2);
manager->set_kernel_buffer_count();
}

setDynamicProperty(ui->run_button, "running", start);
Expand Down
8 changes: 8 additions & 0 deletions src/iio_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ void iio_manager::set_data_rate(double rate) {
iio_block->set_data_rate(rate);
}

void iio_manager::set_kernel_buffer_count(int kb) {
if(kb) {
m_analogin->setKernelBuffersCount(kb);
} else {
m_analogin->setKernelBuffersCount(KERNEL_BUFFERS_DEFAULT);
}
}

void iio_manager::enableMixedSignal(m2k::mixed_signal_source::sptr mixed_source)
{
for (int i = 0; i < nb_channels; ++i) {
Expand Down
1 change: 1 addition & 0 deletions src/iio_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ namespace adiscope {
void set_buffer_size(port_id id, unsigned long size);
void set_filter_parameters(int channel, int index, bool enable, float TC, float gain, float sample_rate );
void set_data_rate(double rate);
void set_kernel_buffer_count(int kb = 0);

/* VERY ugly hack. The reconfiguration that happens after
* locking/unlocking the flowgraph is sort of broken; the tags
Expand Down

0 comments on commit 1e862f6

Please sign in to comment.