Skip to content

Commit

Permalink
plugins/fmcomms2: Workaround in_out_voltage_filter_fir_en with latest…
Browse files Browse the repository at this point in the history
… libiio

Temporary Workaround

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Jun 27, 2016
1 parent dc97e73 commit 1273024
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/fmcomms2.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,13 @@ static void filter_fir_update(void)
{
bool rx = false, tx = false, rxtx = false;
struct iio_channel *chn;
int ret;

ret = iio_device_attr_read_bool(dev, "in_out_voltage_filter_fir_en", &rxtx);

iio_device_attr_read_bool(dev, "in_out_voltage_filter_fir_en", &rxtx);
if (ret < 0)
iio_channel_attr_read_bool(iio_device_find_channel(dev, "out", false),
"voltage_filter_fir_en", &rxtx);

chn = iio_device_find_channel(dev, "voltage0", false);
if (chn)
Expand All @@ -596,6 +601,7 @@ static void filter_fir_update(void)
static void filter_fir_enable(GtkToggleButton *button, gpointer data)
{
bool rx, tx, rxtx, disable;
int ret;

if (gtk_toggle_button_get_active(button))
return;
Expand All @@ -606,8 +612,11 @@ static void filter_fir_enable(GtkToggleButton *button, gpointer data)
disable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (disable_all_fir_filters));

if (rxtx || disable) {
iio_device_attr_write_bool(dev,
ret = iio_device_attr_write_bool(dev,
"in_out_voltage_filter_fir_en", rxtx);
if (ret < 0)
iio_channel_attr_write_bool(iio_device_find_channel(dev, "out", false),
"voltage_filter_fir_en", rxtx);
} else {
struct iio_channel *chn;
if (rx) {
Expand Down

0 comments on commit 1273024

Please sign in to comment.