]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
preamp always "on" except for CHARLY25.
authorc vw <dl1ycf@darc.de>
Wed, 7 Aug 2019 09:45:44 +0000 (11:45 +0200)
committerc vw <dl1ycf@darc.de>
Wed, 7 Aug 2019 09:45:44 +0000 (11:45 +0200)
hpsdrsim.c
midi3.c
old_protocol.c
rigctl.c

index 1974186f2ff57cd2eceeabd3368282066189e0bd..1259e68b978cc21e8f6dae19af68bd049b6c5475 100644 (file)
@@ -644,7 +644,6 @@ int main(int argc, char *argv[])
                                memset(qsample, 0, OLDRTXLEN*sizeof(double));
                                enable_thread = 1;
                                active_thread = 1;
-                               CommonMercuryFreq = 0;
                                if (pthread_create(&thread, NULL, handler_ep6, NULL) < 0)
                                {
                                        perror("create old protocol thread");
diff --git a/midi3.c b/midi3.c
index 7e035c7d2d4207f53119f8b93967fb16746e4e55..cfab5078bfc81a4f9adcc4986c7e917bb675e85d 100644 (file)
--- a/midi3.c
+++ b/midi3.c
@@ -185,6 +185,10 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) {
            break;
        case PRE:       // only key supported
            if (filter_board == CHARLY25) {
+               //
+               // For hardware other than CHARLY25, we do not
+               // switch preamps
+               //
                new = active_receiver->preamp + active_receiver->dither;
                new++;
                if (new >2) new=0;
@@ -203,12 +207,6 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) {
                        break;
                }
                g_idle_add(ext_update_att_preamp, NULL);
-           } else {
-               // Note that these preamps are not present in most
-               // SDR hardware.
-               new=active_receiver->preamp+1;
-               if (new > 1) new=0;
-               active_receiver->preamp= (new == 1);
            }
            break;
        case ATT:       // Key for ALEX attenuator, wheel or knob for slider
index 58fc8f433773ac4fe9131f4a6ca274ac40bcfb0e..67bddd2cf9c604a6a89eee8b05edcb457846d7f9 100644 (file)
@@ -1110,7 +1110,13 @@ void ozy_send_buffer() {
                output_buffer[C3]|=LT2208_DITHER_ON;
        }
 #endif
-    if(active_receiver->preamp) {
+    if (filter_board == CHARLY25) {
+      if(active_receiver->preamp) {
+        output_buffer[C3]|=LT2208_GAIN_ON;
+      }
+    } else {
+      // preamp always "on" for non-CHARLY25 hardware
+      // (on modern boards the preamp is hard-wired "on")
       output_buffer[C3]|=LT2208_GAIN_ON;
     }
 
@@ -1276,9 +1282,12 @@ void ozy_send_buffer() {
       case 4:
         output_buffer[C0]=0x14;
         output_buffer[C1]=0x00;
-        for(i=0;i<receivers;i++) {
-          output_buffer[C1]|=(receiver[i]->preamp<<i);
-        }
+        //for(i=0;i<receivers;i++) {
+        //  output_buffer[C1]|=(receiver[i]->preamp<<i);
+        //}
+       // preamps always "on".
+        // (on modern boards the preamp is hard-wired "on")
+        output_buffer[C1]=0x0f;
         if(mic_ptt_enabled==0) {
           output_buffer[C1]|=0x40;
         }
@@ -1298,8 +1307,8 @@ void ozy_send_buffer() {
   
         if(device==DEVICE_HERMES || device==DEVICE_ANGELIA || device==DEVICE_ORION
                                  || device==DEVICE_ORION2  || device == DEVICE_STEMLAB) {
-         // bit 5 on somee platforms activates a preamp that is hard-wired "on" on
-         // other platforms, therefore always set it.
+         // setting bit 5 ("Att enable") disables preamp choice
+          // (on modern boards the preamp is hard-wired "on")
           output_buffer[C4]=0x20 | (adc_attenuation[receiver[0]->adc] & 0x1F);
         } else {
 #ifdef RADIOBERRY
@@ -1314,7 +1323,8 @@ void ozy_send_buffer() {
         if(receivers==2) {
           if(device==DEVICE_HERMES || device==DEVICE_ANGELIA || device==DEVICE_ORION
                                    || device==DEVICE_ORION2  || device==DEVICE_STEMLAB) {
-           // bit 5 on somee platforms activates a preamp that is hard-wired "on" on
+           // setting bit 5 ("Att enable") disables preamp choice
+            // (on modern boards the preamp is hard-wired "on")
            // other platforms, therefore always set it.
             output_buffer[C1]=0x20 | (adc_attenuation[receiver[1]->adc] & 0x1F);
           }
index 264a683085f98423f870d54319653481ad290199..ee19965892ee7f24c30f9d0c803561471c8bd06e 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -2857,6 +2857,7 @@ void parse_cmd ( char * cmd_input,int len,int client_sock) {
         else if(strcmp(cmd_str,"PA")==0) { 
                                             // TS-2000 - PA - Set/Read Preamp function status
                                             // PiHPSDR - ZZPA - Set/Read Preamp function status
+                                           // Note that currently, preamp switching is only done for CHARLY25
                                              if(len <=2) {
                                                 if(zzid_flag == 0) {
                                                    sprintf(msg,"PA%1d%1d;",active_receiver->preamp,active_receiver->preamp);