diff --git a/plugins/fmcomms2.c b/plugins/fmcomms2.c index cd5735e65..9780627f9 100644 --- a/plugins/fmcomms2.c +++ b/plugins/fmcomms2.c @@ -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) @@ -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; @@ -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) {