]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
added CW fix to protocol 2
authorJohn Melton - G0ORX <john.d.melton@googlemail.c>
Sat, 2 Dec 2017 14:47:36 +0000 (14:47 +0000)
committerJohn Melton - G0ORX <john.d.melton@googlemail.c>
Sat, 2 Dec 2017 14:47:36 +0000 (14:47 +0000)
new_protocol.c
old_protocol.c

index 33e45d49444394570cf00ac9f64cd580c0c8bc53..78da6c8e7b9ad61f69253b50b7b0612c1e3f42de 100644 (file)
@@ -182,6 +182,8 @@ static unsigned char high_priority_buffer_to_radio[1444];
 static unsigned char transmit_specific_buffer[60];
 static unsigned char receive_specific_buffer[1444];
 
+static int local_ptt=0;
+
 static void new_protocol_high_priority();
 static void new_protocol_general();
 static void new_protocol_receive_specific();
@@ -1396,35 +1398,21 @@ static void process_high_priority(unsigned char *buffer) {
     ptt=high_priority_buffer[4]&0x01;
     dot=(high_priority_buffer[4]>>1)&0x01;
     dash=(high_priority_buffer[4]>>2)&0x01;
-
-/*
-if(ptt!=previous_ptt) {
-  fprintf(stderr,"ptt=%d\n",ptt);
-}
-if(dot!=previous_dot) {
-  fprintf(stderr,"dot=%d\n",dot);
-}
-if(dash!=previous_dash) {
-  fprintf(stderr,"dash=%d\n",dash);
-}
-*/
     pll_locked=(high_priority_buffer[4]>>3)&0x01;
-
-
     adc_overload=high_priority_buffer[5]&0x01;
     exciter_power=((high_priority_buffer[6]&0xFF)<<8)|(high_priority_buffer[7]&0xFF);
     alex_forward_power=((high_priority_buffer[14]&0xFF)<<8)|(high_priority_buffer[15]&0xFF);
     alex_reverse_power=((high_priority_buffer[22]&0xFF)<<8)|(high_priority_buffer[23]&0xFF);
     supply_volts=((high_priority_buffer[49]&0xFF)<<8)|(high_priority_buffer[50]&0xFF);
 
-    if(previous_ptt!=ptt && vfo[id].mode!=modeCWU && vfo[id].mode!=modeCWL) {
-      g_idle_add(ext_ptt_update,(gpointer)(long)(ptt));
-    } else if(previous_dot!=dot && (vfo[id].mode==modeCWU || vfo[id].mode==modeCWL)) {
-      g_idle_add(ext_ptt_update,(gpointer)(long)(dot));
-    } else if(previous_dash!=dash && (vfo[id].mode==modeCWU || vfo[id].mode==modeCWL)) {
-      g_idle_add(ext_ptt_update,(gpointer)(long)(dash));
+    int tx_vfo=split?VFO_B:VFO_A;
+    local_ptt=ptt;
+    if(vfo[tx_vfo].mode==modeCWL || vfo[tx_vfo].mode==modeCWU) {
+      local_ptt=ptt|dot|dash;
+    }
+    if(previous_ptt!=local_ptt) {
+      g_idle_add(ext_ptt_update,(gpointer)(long)(local_ptt));
     }
-
 }
 
 static void process_mic_data(int bytes) {
index 11cf2eff726b3a939a2cccbd92bc5a2792c78e79..6ec5fee072ec316c4f513680f370325e00829918 100644 (file)
@@ -503,7 +503,7 @@ static void process_ozy_input_buffer(char  *buffer) {
       local_ptt=ptt|dot|dash;
     }
     if(previous_ptt!=local_ptt) {
-      g_idle_add(ext_ptt_update,(gpointer)(long)(ptt));
+      g_idle_add(ext_ptt_update,(gpointer)(long)(local_ptt));
     }