]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
some stream-lining to prepeare for a huge pull request
authorc vw <dl1ycf@darc.de>
Fri, 31 May 2019 08:35:08 +0000 (10:35 +0200)
committerc vw <dl1ycf@darc.de>
Fri, 31 May 2019 08:35:08 +0000 (10:35 +0200)
hpsdrsim.c
iambic.c
old_protocol.c
ps_menu.c
radio.c
receiver.c
receiver.h
rigctl.c
transmitter.c

index c267d14cf375b5f72f6a46c7b08537dc7065020d..0b73aefc6b920055edfc7cace93e90404d19d4ce 100644 (file)
  * RF3 signal strength varies according to TX-drive and TX-ATT settings
  * RF4 signal strength is normalized to amplitude of 0.407
  *
- * RF1 and RF2 are associated with ADC1 and ADC2.
- * RF3 also goes to ADC1 upon TX
- * RF4 is the TX DAC signal. Upon TX, it goes to RX2 for Metis, RX4 for Hermes, and RX5 beyond.
- *
- * The SDR application has to make the proper ADC settings!
- *
- * Without PURESIGNAL, the standard association is:
- * RX1=ADC1, RX2=ADC2  (ADC2 not present for METIS and ANAN-10/10E/100)
- *
- * When using PURESIGNAL, the standard association is:
+ * The connection with the ADCs are:
+ * first  ADC: RF1 upon receive, RF3 upon transmit
+ * second ADC: RF2
  *
- * DEVICE=METIS:  RX1=ADC1, RX2=TX-DAC
- * DEVICE=HERMES: RX1=ADC1, RX2=ADC1, RX3=ADC2, RX4=TX-DAC
- * DEVICE=ORION:  RX1=ADC1, RX2=ADC1, RX3=ADC3, RX4=ADC1, RX5=TX-DAC (also for ANGELIA and ORION2)
- *
- * Note that for STEMlab (RedPitaya) based SDRs, there is usually a fixed association
+ * RF4 is the TX DAC signal. Upon TX, it goes to RX2 for Metis, RX4 for Hermes, and RX5 beyond.
+ * Since the feedback runs at the RX sample rate while the TX sample rate is fixed (48000 Hz),
+ * we have to re-sample and do this in a very stupid way (linear interpolation).
  *
+ * The SDR application has to make the proper ADC settings, except for STEMlab
+ * (RedPitaya based SDRs), where there is a fixed association
  * RX1=ADC1, RX2=ADC2, RX3=ADC2, RX4=TX-DAC
- *
- * And this setting is NOT AFFECTED by the ADC settings in the HPSDR protocol.
+ * and the PURESIGNAL feedback signal is connected to the second ADC.
  *
  * Audio sent to the "radio" is played via the first available output channel.
  * This works on MacOS (PORTAUDIO) and Linux (ALSA).
@@ -172,8 +164,10 @@ int          envptr=0;
 #ifdef MICSAMPLES
 //
 // Raw audio data (48000 16-bit int words) is read from a file and stored.
-// As soon as the ALEX attenuators are engaged, these mic samples are
-// sent to the SDR program ONCE.
+// As soon as the attenuation of RX1 goes above 20dB, these samples are
+// sent to the SDR (one shot), and when the attenuation goes below 10dB, this system
+// is reset, so playing with the ALEX ATT buttons or with the ATT slider you can
+// send mic samples to the SDR application and do some testing.
 //
 static int16_t micsamples[48000];
 int micsamples_ptr=-2;
@@ -318,8 +312,6 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-       fprintf(stderr, "DEBUG_TCP: RP <--> PC: sock_TCP_Server: %d\n", sock_TCP_Server);
-
        setsockopt(sock_TCP_Server, SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
 
        int tcpmaxseg = 1032;
@@ -340,7 +332,7 @@ int main(int argc, char *argv[])
        }
 
        listen(sock_TCP_Server, 1024);
-       fprintf(stderr, "DEBUG_TCP: RP <--> PC: Listening for TCP client connection request\n");
+       fprintf(stderr, "Listening for TCP client connection request\n");
 
         int flags = fcntl(sock_TCP_Server, F_GETFL, 0);
         fcntl(sock_TCP_Server, F_SETFL, flags | O_NONBLOCK);
@@ -437,7 +429,7 @@ int main(int argc, char *argv[])
                 {
                         if((sock_TCP_Client = accept(sock_TCP_Server, NULL, NULL)) > -1)
                         {
-                                fprintf(stderr, "DEBUG_TCP: RP <--> PC: sock_TCP_Client: %d connected to sock_TCP_Server: %d\n", sock_TCP_Client, sock_TCP_Server);
+                                fprintf(stderr,"sock_TCP_Client: %d connected to sock_TCP_Server: %d\n", sock_TCP_Client, sock_TCP_Server);
                         }
                        // This avoids firing accept() too often if it constantly fails
                        udp_retries=0;
@@ -453,7 +445,7 @@ int main(int argc, char *argv[])
                                // processing an invalid packet is too dangerous -- skip it!
                                if (bytes_read != 1032)
                                {
-                                       fprintf(stderr,"DEBUG_PROT: RvcMsg Code=0x%08x Len=%d\n", code, (int)bytes_read);
+                                       fprintf(stderr,"InvalidLength: RvcMsg Code=0x%08x Len=%d\n", code, (int)bytes_read);
                                        break;
                                }
 
@@ -462,7 +454,7 @@ int main(int argc, char *argv[])
 
                                if (seqnum != last_seqnum + 1)
                                {
-                                       fprintf(stderr,"DEBUG_SEQ: SEQ ERROR: last %ld, recvd %ld\n", (long)last_seqnum, (long)seqnum);
+                                       fprintf(stderr,"SEQ ERROR: last %ld, recvd %ld\n", (long)last_seqnum, (long)seqnum);
                                }
 
                                last_seqnum = seqnum;
@@ -567,12 +559,12 @@ int main(int argc, char *argv[])
                                // respond to an incoming Metis detection request
                                case 0x0002feef:
 
-                               fprintf(stderr, "DEBUG_PROT: RP -> PC: respond to an incoming Metis detection request / code: 0x%08x\n", code);
+                               fprintf(stderr, "Respond to an incoming Metis detection request / code: 0x%08x\n", code);
 
                                // processing an invalid packet is too dangerous -- skip it!
                                if (bytes_read != 63)
                                {
-                                       fprintf(stderr,"DEBUG_PROT: RvcMsg Code=0x%08x Len=%d\n", code, (int)bytes_read);
+                                       fprintf(stderr,"InvalidLength: RvcMsg Code=0x%08x Len=%d\n", code, (int)bytes_read);
                                        break;
                                }
                                reply[2] = 2 + active_thread;
@@ -588,7 +580,7 @@ int main(int argc, char *argv[])
                                        {
                                            if (send(sock_TCP_Client, buffer, 60, 0) < 0)
                                            {
-                                               fprintf(stderr, "DEBUG_TCP: RP -> PC: TCP send error occurred when responding to an incoming Metis detection request!\n");
+                                               fprintf(stderr, "TCP send error occurred when responding to an incoming Metis detection request!\n");
                                            }
                                            // close the TCP socket which was only used for the detection
                                            close(sock_TCP_Client);
@@ -605,12 +597,12 @@ int main(int argc, char *argv[])
                                // stop the Red Pitaya to PC transmission via handler_ep6
                                case 0x0004feef:
 
-                               fprintf(stderr, "DEBUG_PROT: RP -> PC: stop the transmission via handler_ep6 / code: 0x%08x\n", code);
+                               fprintf(stderr, "STOP the transmission via handler_ep6 / code: 0x%08x\n", code);
 
                                // processing an invalid packet is too dangerous -- skip it!
                                if (bytes_read != 64)
                                {
-                                       fprintf(stderr,"DEBUG_PROT: RvcMsg Code=0x%08x Len=%d\n", code, bytes_read);
+                                       fprintf(stderr,"InvalidLength: RvcMsg Code=0x%08x Len=%d\n", code, bytes_read);
                                        break;
                                }
 
@@ -629,7 +621,7 @@ int main(int argc, char *argv[])
                                //// This special code 0x11 is no longer needed, is does exactly the same thing
                                //// as the other start codes 0x01, 0x02, 0x03
 
-                               fprintf(stderr, "DEBUG_TCP: PC -> RP: TCP METIS-start message received / code: 0x%08x\n", code);
+                               fprintf(stderr, "TCP METIS-start message received / code: 0x%08x\n", code);
 
                                /* FALLTHROUGH */
 
@@ -637,12 +629,12 @@ int main(int argc, char *argv[])
                                case 0x0204feef:
                                case 0x0304feef:
 
-                               fprintf(stderr, "DEBUG_PROT: RP <--> PC: start the handler_ep6 thread / code: 0x%08x\n", code);
+                               fprintf(stderr, "START the handler_ep6 thread / code: 0x%08x\n", code);
 
                                // processing an invalid packet is too dangerous -- skip it!
                                if (bytes_read != 64)
                                {
-                                       fprintf(stderr,"DEBUG_PROT: RvcMsg Code=0x%08x Len=%d\n", code, bytes_read);
+                                       fprintf(stderr,"InvalidLength: RvcMsg Code=0x%08x Len=%d\n", code, bytes_read);
                                        break;
                                }
 
@@ -653,6 +645,11 @@ int main(int argc, char *argv[])
                                addr_ep6.sin_addr.s_addr = addr_from.sin_addr.s_addr;
                                addr_ep6.sin_port = addr_from.sin_port;
 
+                               //
+                               // The initial value of txptr defines the delay between
+                               // TX samples sent to the SDR and PURESIGNAL feedback
+                               // samples arriving
+                               //
                                 txptr=(25 << rate) * 126;  // must be even multiple of 63
                                 rxptr=0;
                                memset(isample, 0, RTXLEN*sizeof(double));
@@ -672,11 +669,11 @@ int main(int argc, char *argv[])
                                // Possibly a discovery packet of the New protocol, otherwise a severe error
                                if (bytes_read == 60 && code == 0 && buffer[4] == 0x02)
                                {
-                                       fprintf(stderr,"DEBUG_PROT: PC -> RP: NewProtocol discovery packet received (no response)\n");
+                                       fprintf(stderr,"NewProtocol discovery packet received (we won't respond)\n");
                                }
                                else
                                {
-                                       fprintf(stderr,"DEBUG_PROT: PC -> RP: invalid code: 0x%08x (Len=%d)\n", code, bytes_read);
+                                       fprintf(stderr,"PackedInvalidCode: 0x%08x (Len=%d)\n", code, bytes_read);
                                }
                                break;
                        }
@@ -921,10 +918,9 @@ void *handler_ep6(void *arg)
                127, 127, 127, 24, 0, 0, 0, 0,
                127, 127, 127, 32, 66, 66, 66, 66
        };
-        int32_t rf1isample,rf1qsample;
-        int32_t rf2isample,rf2qsample;
-        int32_t rf3isample,rf3qsample;
-        int32_t rf4isample,rf4qsample;
+        int32_t adc1isample,adc1qsample;
+        int32_t adc2isample,adc2qsample;
+        int32_t dacisample,dacqsample;
 
        int32_t myisample,myqsample;
         int16_t ssample;
@@ -1024,40 +1020,49 @@ void *handler_ep6(void *arg)
                    pointer += 8;
                    memset(pointer, 0, 504);
                    for (j=0; j<n; j++) {
-                       // ADC1: noise + weak tone on RX, feedback sig. on TX
-                       if (ptt) {
+                       // ADC1: noise + weak tone on RX, feedback sig. on TX (except STEMlab)
+                       if (ptt && !isc25) {
+                         i1=isample[rxptr]*txdrv_dbl;
+                         q1=qsample[rxptr]*txdrv_dbl;
+                         fac=IM3a+IM3b*(i1*i1+q1*q1);
+                         adc1isample= (txatt_dbl*i1*fac+noiseItab[noiseIQpt]) * 8388607.0;
+                         adc1qsample= (txatt_dbl*q1*fac+noiseItab[noiseIQpt]) * 8388607.0;
+                       } else {
+                         adc1isample= noiseItab[noiseIQpt] * 8388607.0;                        // Noise
+                         adc1isample += T0800Itab[pt0800] * 83.886070 *rxatt_dbl[0];   // tone 100 dB below peak
+                         adc1qsample=noiseQtab[noiseIQpt] * 8388607.0;
+                         adc1qsample += T0800Qtab[pt0800] * 83.886070 *rxatt_dbl[0];
+                       }
+                       // ADC2: noise + stronger tone on RX, feedback sig. on TX (only STEMlab)
+                       if (ptt && isc25) {
                          i1=isample[rxptr]*txdrv_dbl;
                          q1=qsample[rxptr]*txdrv_dbl;
                          fac=IM3a+IM3b*(i1*i1+q1*q1);
-                         rf1isample= (txatt_dbl*i1*fac+noiseItab[noiseIQpt]) * 8388607.0;
-                         rf1qsample= (txatt_dbl*q1*fac+noiseItab[noiseIQpt]) * 8388607.0;
+                         adc2isample= (txatt_dbl*i1*fac+noiseItab[noiseIQpt]) * 8388607.0;
+                         adc2qsample= (txatt_dbl*q1*fac+noiseItab[noiseIQpt]) * 8388607.0;
                        } else {
-                         rf1isample= noiseItab[noiseIQpt] * 8388607.0;                 // Noise
-                         rf1isample += T0800Itab[pt0800] * 83.886070 *rxatt_dbl[0];    // tone 100 dB below peak
-                         rf1qsample=noiseQtab[noiseIQpt] * 8388607.0;
-                         rf1qsample += T0800Qtab[pt0800] * 83.886070 *rxatt_dbl[0];
+                         adc2isample= noiseItab[noiseIQpt] * 8388607.0;                        // Noise
+                         adc2isample += T2000Itab[pt2000] * 838.86070 * rxatt_dbl[1];  // tone 80 dB below peak
+                         adc2qsample=noiseQtab[noiseIQpt] * 8388607.0;
+                         adc2qsample += T2000Qtab[pt2000] * 838.86070 * rxatt_dbl[1];
                        }
-                       rf2isample= noiseItab[noiseIQpt] * 8388607.0;                   // Noise
-                       rf2isample += T2000Itab[pt2000] * 838.86070 * rxatt_dbl[1];     // tone 80 dB below peak
-                       rf2qsample=noiseQtab[noiseIQpt] * 8388607.0;
-                       rf2qsample += T2000Qtab[pt2000] * 838.86070 * rxatt_dbl[1];
                        //
-                       // RF4: TX signal with peak=0.4
+                       // TX signal with peak=0.4
                        //
-                       rf4isample= isample[rxptr] * 0.400 * 8388607.0;
-                       rf4qsample= qsample[rxptr] * 0.400 * 8388607.0;
+                       dacisample= isample[rxptr] * 0.400 * 8388607.0;
+                       dacqsample= qsample[rxptr] * 0.400 * 8388607.0;
 
                        for (k=0; k< receivers; k++) {
                            myisample=0;
                            myqsample=0;
                            switch (rx_adc[k]) {
                              case 0: // ADC1
-                               myisample=rf1isample;
-                               myqsample=rf1qsample;
+                               myisample=adc1isample;
+                               myqsample=adc1qsample;
                                break;
                              case 1: // ADC2
-                               myisample=rf2isample;
-                               myqsample=rf2qsample;
+                               myisample=adc2isample;
+                               myqsample=adc2qsample;
                                break;
                              default:
                                myisample=0;
@@ -1066,18 +1071,18 @@ void *handler_ep6(void *arg)
                            }
                            if (ismetis && ptt && (k==1)) {
                                // METIS: TX DAC signal goes to RX2 when TXing
-                               myisample=rf4isample;
-                               myqsample=rf4qsample;
+                               myisample=dacisample;
+                               myqsample=dacqsample;
                            }
                            if (ishermes && ptt && (k==3)) {
                                // HERMES: TX DAC signal goes to RX4 when TXing
-                               myisample=rf4isample;
-                               myqsample=rf4qsample;
+                               myisample=dacisample;
+                               myqsample=dacqsample;
                            }
                            if (isorion && ptt && (k==4)) {
                                // ANGELIA and beyond: TX DAC signal goes to RX5 when TXing
-                               myisample=rf4isample;
-                               myqsample=rf4qsample;
+                               myisample=dacisample;
+                               myqsample=dacqsample;
                            }
                            *pointer++ = (myisample >> 16) & 0xFF;
                            *pointer++ = (myisample >>  8) & 0xFF;
@@ -1141,7 +1146,7 @@ void *handler_ep6(void *arg)
                {
                        if (sendmsg(sock_TCP_Client, &msghdr, 0) < 0)
                        {
-                               fprintf(stderr, "DEBUG_TCP: RP -> PC: TCP sendmsg error occurred at sequence number: %u !\n", counter);
+                               fprintf(stderr, "TCP sendmsg error occurred at sequence number: %u !\n", counter);
                        }
                }
                else
@@ -1314,7 +1319,7 @@ void audio_get_cards() {
     descr = snd_device_name_get_hint(*n, "DESC");
     io = snd_device_name_get_hint(*n, "IOID");
     
-    if(strncmp("dmix:", name, 5)==0/* || strncmp("pulse", name, 5)==0*/) {
+    if(strncmp("dmix:", name, 5)==0) {
       fprintf(stderr,"name=%s descr=%s io=%s\n",name, descr, io);
       device_id=malloc(64);
       
index 56d11b2d3681caec0e88ac80745436d06b8feefc..3609ee36c9e11fbe42bc7f84a4e99029c3c30f25 100644 (file)
--- a/iambic.c
+++ b/iambic.c
@@ -357,8 +357,6 @@ static void* keyer_thread(void *arg) {
     int old_volume;
     struct sched_param param;
 
-    // In Linux, the new scheduling policy will be effective for the
-   //  calling thread only.
     param.sched_priority = MY_PRIORITY;
     if(sched_setscheduler((pid_t)0, SCHED_FIFO, &param) == -1) {
             perror("sched_setscheduler failed");
@@ -381,9 +379,9 @@ static void* keyer_thread(void *arg) {
           // firing up the TX. This induces a small delay when hitting the key for
           // the first time, but excludes that the first dot is swallowed.
           // Note: if out-of-band, mox will never come, therefore
-          // give up after 100 msec.
-          i=100;
-          while (!mox && i-- > 0) usleep(1000);
+          // give up after 200 msec.
+          i=200;
+          while ((!mox || cw_not_ready) && i-- > 0) usleep(1000L);
           cwvox=(int) cw_keyer_hang_time;
        }
 
index b4a65a3e3712f3fb10e910f2ec1769f8a3245e86..579a878dcbbdaf5963960f3256d06fee827cc85d 100644 (file)
@@ -953,11 +953,11 @@ void ozy_send_buffer() {
 #ifdef PURESIGNAL
     //
     // Upon TX, we might have to activate a different RX path for the
-    // attenuated feedback signal. Use feedback_antenna == 0, if
+    // attenuated feedback signal. Use alex_antenna == 0, if
     // the feedback signal is routed automatically/internally
     // If feedback is to the second ADC, leave RX1 ANT settings untouched
     //
-    if (isTransmitting() && transmitter->puresignal && receiver[PS_RX_FEEDBACK]->adc == 0) i=receiver[PS_RX_FEEDBACK]->feedback_antenna;
+    if (isTransmitting() && transmitter->puresignal && receiver[PS_RX_FEEDBACK]->adc == 0) i=receiver[PS_RX_FEEDBACK]->alex_antenna;
 #endif
     switch(i) {
       case 3:  // Alex: RX2 IN, ANAN: EXT1, ANAN7000: still uses internal feedback 
index 5213ed3646e0a669863b7bd38256835cf84fb761..4e13f034cdc46047478b7ab4d541cb81c17f958d 100644 (file)
--- a/ps_menu.c
+++ b/ps_menu.c
@@ -267,11 +267,11 @@ static void ps_ant_cb(GtkWidget *widget, gpointer data) {
       case 0:  // AUTO (Internal), feedback goes to first ADC
       case 3:  // EXT1,            feedback goes to first ADC
       case 4:  // EXT2,            feedback goes to first ADC
-       receiver[PS_RX_FEEDBACK]->feedback_antenna = (int) (uintptr_t) data;
+       receiver[PS_RX_FEEDBACK]->alex_antenna = (int) (uintptr_t) data;
        receiver[PS_RX_FEEDBACK]->adc              = 0;
        break;
       case 99: // RX2,              feedback goes to second ADC
-       receiver[PS_RX_FEEDBACK]->feedback_antenna = 0;
+       receiver[PS_RX_FEEDBACK]->alex_antenna = 0;
        receiver[PS_RX_FEEDBACK]->adc              = 1;
        break;
     }
@@ -428,7 +428,7 @@ void ps_menu(GtkWidget *parent) {
 
   GtkWidget *ps_ant_auto=gtk_radio_button_new_with_label(NULL,"AUTO");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ps_ant_auto), 
-    (receiver[PS_RX_FEEDBACK]->feedback_antenna == 0) && (receiver[PS_RX_FEEDBACK]->adc == 0));
+    (receiver[PS_RX_FEEDBACK]->alex_antenna == 0) && (receiver[PS_RX_FEEDBACK]->adc == 0));
   gtk_widget_show(ps_ant_auto);
   gtk_grid_attach(GTK_GRID(grid), ps_ant_auto, col, row, 1, 1);
   g_signal_connect(ps_ant_auto,"toggled", G_CALLBACK(ps_ant_cb), (gpointer) (long) 0);
@@ -436,7 +436,7 @@ void ps_menu(GtkWidget *parent) {
 
   GtkWidget *ps_ant_ext1=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(ps_ant_auto),"EXT1");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ps_ant_ext1),
-    (receiver[PS_RX_FEEDBACK]->feedback_antenna==3) && (receiver[PS_RX_FEEDBACK]->adc == 0));
+    (receiver[PS_RX_FEEDBACK]->alex_antenna==3) && (receiver[PS_RX_FEEDBACK]->adc == 0));
   gtk_widget_show(ps_ant_ext1);
   gtk_grid_attach(GTK_GRID(grid), ps_ant_ext1, col, row, 1, 1);
   g_signal_connect(ps_ant_ext1,"toggled", G_CALLBACK(ps_ant_cb), (gpointer) (long) 3);
@@ -444,7 +444,7 @@ void ps_menu(GtkWidget *parent) {
 
   GtkWidget *ps_ant_ext2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(ps_ant_auto),"EXT2");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ps_ant_ext2),
-    (receiver[PS_RX_FEEDBACK]->feedback_antenna==4) && (receiver[PS_RX_FEEDBACK]->adc == 0));
+    (receiver[PS_RX_FEEDBACK]->alex_antenna==4) && (receiver[PS_RX_FEEDBACK]->adc == 0));
   gtk_widget_show(ps_ant_ext2);
   gtk_grid_attach(GTK_GRID(grid), ps_ant_ext2, col, row, 1, 1);
   g_signal_connect(ps_ant_ext2,"toggled", G_CALLBACK(ps_ant_cb), (gpointer) (long) 4);
diff --git a/radio.c b/radio.c
index b646170f99c41d65a1936da1d8abeec8c0932162..b52f5f869fc982b9578cca0ee5a0ca183b009ad6 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -1534,8 +1534,8 @@ void radioSaveState() {
       receiver_save_state(receiver[i]);
     }
 #ifdef PURESIGNAL
-    // There is little to save.
-    // An exception is the feedback_antenna stored in PS_RX_FEEDBACK
+    // The only variables of interest in this receiver are
+    // the alex_antenna an the adc
     receiver_save_state(receiver[PS_RX_FEEDBACK]);
 #endif
     transmitter_save_state(transmitter);
index 9a1ed097c1a020a792fbb8af052e35700e52bdb2..d2300e40b92db0dfeaa68943b0b7471437b312f6 100644 (file)
@@ -199,11 +199,6 @@ void receiver_save_state(RECEIVER *rx) {
   sprintf(value,"%d",rx->waterfall_automatic);
   setProperty(name,value);
   
-#ifdef PURESIGNAL
-  sprintf(name,"receiver.%d.feedback_antenna",rx->id);
-  sprintf(value,"%d",rx->feedback_antenna);
-  setProperty(name,value);
-#endif
   sprintf(name,"receiver.%d.alex_antenna",rx->id);
   sprintf(value,"%d",rx->alex_antenna);
   setProperty(name,value);
@@ -360,11 +355,6 @@ fprintf(stderr,"receiver_restore_state: id=%d\n",rx->id);
   value=getProperty(name);
   if(value) rx->waterfall_automatic=atoi(value);
 
-#ifdef PURESIGNAL
-  sprintf(name,"receiver.%d.feedback_antenna",rx->id);
-  value=getProperty(name);
-  if(value) rx->feedback_antenna=atoi(value);
-#endif
   sprintf(name,"receiver.%d.alex_antenna",rx->id);
   value=getProperty(name);
   if(value) rx->alex_antenna=atoi(value);
@@ -798,7 +788,6 @@ fprintf(stderr,"create_pure_signal_receiver: id=%d buffer_size=%d\n",id,buffer_s
   rx->nr2_npe_method=0;
   rx->nr2_ae=1;
   
-  rx->feedback_antenna=0;
   rx->alex_antenna=0;
   rx->alex_attenuation=0;
 
@@ -817,7 +806,7 @@ fprintf(stderr,"create_pure_signal_receiver: id=%d buffer_size=%d\n",id,buffer_s
 
   rx->low_latency=0;
 
-  // not much to be restored, except feedback_antenna
+  // not much to be restored, except alex_antenna and adc
   if (id == PS_RX_FEEDBACK) receiver_restore_state(rx);
 
   int result;
@@ -931,10 +920,6 @@ fprintf(stderr,"create_receiver: id=%d default ddc=%d adc=%d\n",rx->id, rx->ddc,
   rx->nr2_npe_method=0;
   rx->nr2_ae=1;
   
-#ifdef PURESIGNAL
-  rx->feedback_antenna=0;
-#endif
-
   BAND *b=band_get_band(vfo[rx->id].band);
   rx->alex_antenna=b->alexRxAntenna;
   rx->alex_attenuation=b->alexAttenuation;
index 52970caf996afec2fa2f305fed0e1b828153043e..39bf084e1683160bdb01052e5d36d09b3f0fecd2 100644 (file)
@@ -89,13 +89,6 @@ typedef struct _receiver {
   int alex_antenna;
   int alex_attenuation;
 
-#ifdef PURESIGNAL
-  // indicates to which ALEX RX antenna the attenuated feedback
-  // signal from the PA goes. The coding is the same as for alex_antenna,
-  // except that this connector is only used when transmitting.
-  int feedback_antenna;
-#endif
-
   int filter_low;
   int filter_high;
 
index e21ad82329307bd948945d03d8a2e04f985b2def..e1dcc8d02db38f37a74d6dd64852057665cdaf23 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -552,7 +552,7 @@ static gpointer rigctl_cw_thread(gpointer data)
        // Note that if out-of-band, we would wait
        // forever here, so allow at most 200 msec
        // We also have to wait for cw_not_ready becoming zero
-       i=100;
+       i=200;
         while ((!mox || cw_not_ready) && i-- > 0) usleep(1000L);
        // still no MOX? --> silently discard CW character and give up
        if (!mox) {
index 805bd9b7d943bf7c81a886007d54ae51471b9f9b..18878b86ab4fc5f37996bd535a9aaa89397572a6 100644 (file)
@@ -1139,7 +1139,7 @@ void tx_set_ps_sample_rate(TRANSMITTER *tx,int rate) {
 //
 void cw_hold_key(int state) {
   if (state) {
-    cw_key_down = 480000;    // up to 10 sec
+    cw_key_down = 960000;    // up to 20 sec
   } else {
     cw_key_down = 0;
   }