]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
minor improvements (mostly comments)
authorDL1YCF <dl1ycf@darc.de>
Mon, 5 Dec 2022 18:49:27 +0000 (19:49 +0100)
committerDL1YCF <dl1ycf@darc.de>
Mon, 5 Dec 2022 18:49:27 +0000 (19:49 +0100)
discovery.c
receiver.c

index 06926daa4559e6ecab16632faa23eb90b007774d..bf26a2e0dd2b59c271cd483383742ff2cc48f364 100644 (file)
@@ -540,7 +540,20 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
     gtk_widget_show_all(discovery_dialog);
 fprintf(stderr,"showing device dialog\n");
 
-    // autostart if one device and autostart enabled
+    //
+    // Autostart and RedPitaya radios:
+    //
+    // Autostart means that if there only one device detected, start the
+    // radio without the need to click the "Start" button.
+    //
+    // If this is the first round of a RedPitaya (STEMlab) discovery,
+    // there may be more than one SDR app on the RedPitya available
+    // from which one can choose one.
+    // With autostart, there is no choice in this case, the SDR app
+    // with highest priority is automatically chosen (and started),
+    // and then the discovery process is re-initiated for RedPitya
+    // devices only.
+    //
     g_print("%s: devices=%d autostart=%d\n",__FUNCTION__,devices,autostart);
 
     if(devices==1 && autostart) {
index a50e724f82eb0726dcdd1fcf1d7ff7469ca5853c..8fa91758a4e5f2cb2d804eb290524e0d5ee619e9 100644 (file)
@@ -1327,12 +1327,15 @@ void receiver_frequency_changed(RECEIVER *rx) {
 
   if(vfo[id].ctun) {
 
-    long long frequency=vfo[id].frequency;
-    long long half=(long long)rx->sample_rate/2LL;
-    long long rx_low=vfo[id].ctun_frequency+rx->filter_low;
-    long long rx_high=vfo[id].ctun_frequency+rx->filter_high;
-
     if(rx->zoom>1) {
+      //
+      // Adjust PAN if new filter width has moved out of
+      // current display range
+      //
+      long long frequency=vfo[id].frequency;
+      long long half=(long long)rx->sample_rate/2LL;
+      long long rx_low=vfo[id].ctun_frequency+rx->filter_low;
+      long long rx_high=vfo[id].ctun_frequency+rx->filter_high;
       long long min_display=frequency-half+(long long)((double)rx->pan*rx->hz_per_pixel);
       long long max_display=min_display+(long long)((double)rx->width*rx->hz_per_pixel);
       if(rx_low<=min_display) {
@@ -1346,6 +1349,10 @@ void receiver_frequency_changed(RECEIVER *rx) {
       }
     }
 
+    //
+    // The (HPSDR) frequency does not change in CTUN,
+    // so simply compute new offset and tell WDSP about it
+    //
     vfo[id].offset=vfo[id].ctun_frequency-vfo[id].frequency;
     if(vfo[id].rit_enabled) {
       vfo[id].offset+=vfo[id].rit;
@@ -1353,6 +1360,9 @@ void receiver_frequency_changed(RECEIVER *rx) {
     set_offset(rx,vfo[id].offset);
   } else {
     switch(protocol) {
+      case ORIGINAL_PROTOCOL:
+       // P1 does this automatically
+        break;
       case NEW_PROTOCOL:
         schedule_high_priority(); // send new frequency
         break;