]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Fixed CW pulse shaping (exchanging I and Q), my ANAN-7000 needs this.
authorc vw <dl1ycf@darc.de>
Thu, 30 May 2019 12:28:14 +0000 (14:28 +0200)
committerc vw <dl1ycf@darc.de>
Thu, 30 May 2019 12:28:14 +0000 (14:28 +0200)
rigctl.c
transmitter.c

index 052218f52d4c9e80f5429f05c2a526f5a62cd537..e21ad82329307bd948945d03d8a2e04f985b2def 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -550,9 +550,10 @@ static gpointer rigctl_cw_thread(gpointer data)
         g_idle_add(ext_mox_update ,(gpointer)1);
        // have to wait until it is really there
        // Note that if out-of-band, we would wait
-       // forever here, so allow at most 100 msec
+       // forever here, so allow at most 200 msec
+       // We also have to wait for cw_not_ready becoming zero
        i=100;
-        while (!mox && i-- > 0) usleep(1000L);
+        while ((!mox || cw_not_ready) && i-- > 0) usleep(1000L);
        // still no MOX? --> silently discard CW character and give up
        if (!mox) {
            CAT_cw_is_active=0;
index 00d5e4e61f2695a0159279219fab7a200d2a07dd..805bd9b7d943bf7c81a886007d54ae51471b9f9b 100644 (file)
@@ -842,8 +842,8 @@ static void full_tx_buffer(TRANSMITTER *tx) {
     // These are the I/Q samples that describe our CW signal
     // The only use we make of it is displaying the spectrum.
     for (j = 0; j < tx->output_samples; j++) {
-      *dp++ = cw_shape_buffer[j];
       *dp++ = 0.0;
+      *dp++ = cw_shape_buffer[j];
     }
   } else {
     update_vox(tx);
@@ -879,7 +879,7 @@ static void full_tx_buffer(TRANSMITTER *tx) {
     }
 
 //
-//  When doing CW, we do not need WDSP since I(t) = cw_shape_buffer(t) and Q(t)=0
+//  When doing CW, we do not need WDSP since Q(t) = cw_shape_buffer(t) and I(t)=0
 //  For the old protocol where the IQ and audio samples are tied together, we can
 //  easily generate a synchronous side tone (and use the function
 //  old_protocol_iq_samples_with_sidetone for this purpose).
@@ -895,10 +895,10 @@ static void full_tx_buffer(TRANSMITTER *tx) {
         // SetTXAPostGen functions are not needed for CW!
        //
         sidevol= 258.0 * cw_keyer_sidetone_volume;  // between 0.0 and 32766.0
-       qsample=0;                                  // will be constantly zero
+       isample=0;                                  // will be constantly zero
         for(j=0;j<tx->output_samples;j++) {
            ramp=cw_shape_buffer[j];                // between 0.0 and 1.0
-           isample=floor(gain*ramp+0.5);           // always non-negative, isample is just the pulse envelope
+           qsample=floor(gain*ramp+0.5);           // always non-negative, isample is just the pulse envelope
            switch(protocol) {
                case ORIGINAL_PROTOCOL:
                    //
@@ -1106,7 +1106,6 @@ void tx_set_ps(TRANSMITTER *tx,int state) {
 }
 
 void tx_set_twotone(TRANSMITTER *tx,int state) {
-  fprintf(stderr,"TX TWO TONE new state=%d\n", state);
   transmitter->twotone=state;
   if(state) {
     // set frequencies and levels