Skip to content

Commit 7631c1c

Browse files
committed
plugins: adrv9002: only read RSSI if RF is enabled
If some port is in any other state than rf_enabled when the plugin initialized or a new profile is loaded, we still try to read the RSSI level which will fail. Hence, just skip that read if not in the proper state. Signed-off-by: Nuno Sa <[email protected]>
1 parent f99b724 commit 7631c1c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/adrv9002.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ static void adrv9002_update_orx_widgets(struct plugin_private *priv, const int c
770770
static void adrv9002_update_rx_widgets(struct plugin_private *priv, const int chann)
771771
{
772772
struct adrv9002_rx *rx = &priv->rx_widgets[chann];
773+
gchar *ensm;
773774

774775
/* rx */
775776
if (!rx->rx.enabled)
@@ -786,7 +787,9 @@ static void adrv9002_update_rx_widgets(struct plugin_private *priv, const int ch
786787
/* generic widgets */
787788
iio_update_widgets_block_signals_by_data(rx->rx.w, rx->rx.num_widgets);
788789
/* labels */
789-
update_label(&rx->rssi);
790+
ensm = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(&rx->rx.ensm.widget));
791+
if (ensm && !strcmp(ensm, "rf_enabled"))
792+
update_label(&rx->rssi);
790793
update_label(&rx->decimated_power);
791794
update_label(&rx->rx.rf_bandwidth);
792795
update_label(&rx->rx.sampling_rate);

0 commit comments

Comments
 (0)