From: DL1YCF <dl1ycf@darc.de>
Date: Sat, 4 Jan 2020 11:38:36 +0000 (+0100)
Subject: small corrections related to CTUN
X-Git-Url: https://git.rkrishnan.org/simplejson/class-simplejson.JSONDecoder.html?a=commitdiff_plain;h=ee7b7ab9ad4897eaff4211bdc66838bc62151731;p=pihpsdr.git

small corrections related to CTUN
---

diff --git a/new_protocol.c b/new_protocol.c
index 62e5436..4483d1b 100644
--- a/new_protocol.c
+++ b/new_protocol.c
@@ -745,7 +745,8 @@ static void new_protocol_high_priority() {
 //  Set DUC frequency
 //
 
-    txFrequency=vfo[txvfo].frequency-vfo[txvfo].lo+vfo[txvfo].offset;
+    txFrequency=vfo[txvfo].frequency-vfo[txvfo].lo;
+    if (vfo[txvfo].ctun) txFrequency += vfo[txvfo].offset;
     if(transmitter->xit_enabled) {
       txFrequency+=transmitter->xit;
     }
diff --git a/vfo.c b/vfo.c
index 2453bdb..9a897b1 100644
--- a/vfo.c
+++ b/vfo.c
@@ -296,6 +296,7 @@ void vfo_band_changed(int b) {
 
   // turn off ctun
   vfo[id].ctun=0;
+  vfo[id].offset=0;
 
   switch(id) {
     case 0: