From: John Melton G0ORX <john.d.melton@googlemail.com>
Date: Thu, 26 Mar 2020 09:12:56 +0000 (+0000)
Subject: fixed references to transmitter when using bandstack with an RTLSDR
X-Git-Url: https://git.rkrishnan.org/pf/components/vdrive/frontends/%22file://%22%22?a=commitdiff_plain;h=2eca714a36af8e5334649ed75cba85cee7919f88;p=pihpsdr.git

fixed references to transmitter when using bandstack with an RTLSDR
---

diff --git a/vfo.c b/vfo.c
index f7823ca..88ddf3b 100644
--- a/vfo.c
+++ b/vfo.c
@@ -347,7 +347,9 @@ void vfo_bandstack_changed(int b) {
       receiver_vfo_changed(receiver[id]);
       BAND *band=band_get_band(vfo[id].band);
       set_alex_rx_antenna(band->alexRxAntenna);
-      set_alex_tx_antenna(band->alexTxAntenna);
+      if(can_transmit) {
+        set_alex_tx_antenna(band->alexTxAntenna);
+      }
       set_alex_attenuation(band->alexAttenuation);
       receiver_vfo_changed(receiver[0]);
       break;
@@ -360,14 +362,14 @@ void vfo_bandstack_changed(int b) {
 
   if(can_transmit) {
     tx_set_mode(transmitter,get_tx_mode());
-  }
-  //
-  // I do not think the band can change within this function.
-  // But out of paranoia, I consider this possiblity here
-  //
-  calcDriveLevel();  // sends HighPrio packet if in new protocol
-  if (protocol == NEW_PROTOCOL) {
-    schedule_general();		// for PA disable
+    //
+    // I do not think the band can change within this function.
+    // But out of paranoia, I consider this possiblity here
+    //
+    calcDriveLevel();  // sends HighPrio packet if in new protocol
+    if (protocol == NEW_PROTOCOL) {
+      schedule_general();		// for PA disable
+    }
   }
   g_idle_add(ext_vfo_update,NULL);