Skip to content

Commit

Permalink
plugins: Re-enable daq2 and update to libiio v1
Browse files Browse the repository at this point in the history
Signed-off-by: Dan <dan.nechita@analog.com>
  • Loading branch information
dNechita committed Dec 11, 2024
1 parent 035bd45 commit a0b13a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(PLUGINS
adrv9009_adv
ad6676
fmcadc3
#daq2
daq2
#ad9739a
AD5628_1
#AD7303
Expand Down
7 changes: 4 additions & 3 deletions plugins/daq2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#include <sys/stat.h>
#include <string.h>

#include <iio.h>
#include <iio/iio.h>

#include "../iio_utils.h"
#include "../libini2.h"
#include "../osc.h"
#include "../iio_widget.h"
Expand Down Expand Up @@ -296,7 +297,7 @@ static GtkWidget * daq2_init(struct osc_plugin *plugin, GtkWidget *notebook, con
ch0 = iio_device_find_channel(adc, "voltage0", false);
ch1 = iio_device_find_channel(adc, "voltage1", false);

if (iio_channel_attr_read_longlong(ch0, "sampling_frequency", &val) == 0)
if (chn_attr_read_longlong(ch0, "sampling_frequency", &val) == 0)
snprintf(attr_val, sizeof(attr_val), "%.3f", (double)val / 1000000.0);
else
snprintf(attr_val, sizeof(attr_val), "%s", "error");
Expand All @@ -314,7 +315,7 @@ static GtkWidget * daq2_init(struct osc_plugin *plugin, GtkWidget *notebook, con
/* Tx Widgets */
ch0 = iio_device_find_channel(dac, "altvoltage0", true);

if (iio_channel_attr_read_longlong(ch0, "sampling_frequency", &val) == 0) {
if (chn_attr_read_longlong(ch0, "sampling_frequency", &val) == 0) {
tx_sampling_freq = (double)val / 1000000.0;
snprintf(attr_val, sizeof(attr_val), "%.3f", tx_sampling_freq);
} else {
Expand Down

0 comments on commit a0b13a9

Please sign in to comment.