]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Fixed vfo_move_to
authorJohn Melton G0ORX <john.d.melton@googlemail.com>
Fri, 8 Nov 2019 18:04:23 +0000 (18:04 +0000)
committerJohn Melton G0ORX <john.d.melton@googlemail.com>
Fri, 8 Nov 2019 18:04:23 +0000 (18:04 +0000)
vfo.c

diff --git a/vfo.c b/vfo.c
index a480cef42d810fc770146a38b59c3596dbf0dea6..8e2c592f67c6ffff91e894f4e88309409cd7253f 100644 (file)
--- a/vfo.c
+++ b/vfo.c
@@ -642,14 +642,15 @@ void vfo_move_to(long long hz) {
   int id=active_receiver->id;
   long long offset=hz;
   long long half=(long long)(active_receiver->sample_rate/2);
-  long long f=vfo[id].frequency-half+offset;
   long long diff; 
+  long long f;
 
 g_print("vfo_move_to: id=%d hz=%lld f=%lld\n",id,hz,f);
-
   if(vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU) {
     offset=(hz/step)*step;
   }
+  f=vfo[id].frequency-half+offset;
+
   if(!locked) {
     if(vfo[id].ctun) {
       diff=f-vfo[id].ctun_frequency;