]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
split: depending on mode, set vfo b up by 1kc or 5kc
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Mon, 6 Nov 2023 14:11:12 +0000 (19:41 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Mon, 6 Nov 2023 14:11:12 +0000 (19:41 +0530)
actions.c
rigctl.c

index 06be50e755727f9d37e868dac4e723c520182772..db8618efbf957b13ea0245bd4db3c4c8dce6ea3f 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -994,6 +994,14 @@ int process_action(void *data) {
       if(a->mode==PRESSED) {
         if(can_transmit) {
           split=split==1?0:1;
+         if (split == 1) {
+             int m = vfo[active_receiver->id].mode;
+             if ((m == modeLSB) || (m == modeUSB)) {
+                 local_set_frequency(VFO_B, vfo[VFO_A].frequency + 5000);
+             } else if ((m == modeCWL) || (m == modeCWU)) {
+                 local_set_frequency(VFO_B, vfo[VFO_A].frequency + 1000);
+             }
+         }
           tx_set_mode(transmitter,get_tx_mode());
           g_idle_add(ext_vfo_update, NULL);
         }
index 7230dd052e9ad016472105a3e81d33c480293b63..6241d28a55cfecac7fb8a9288db95f96225709fb 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -2332,6 +2332,16 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) {
                 send_resp(client->fd, reply);
             } else if (command[5] == ';') {
                 split = atoi(&command[4]);
+               if (split == 1) {
+                   // if mode is LSB or USB, set VFO_B to VFO_A +
+                   // 5khz. If mode is CW, set VFO_B to VFO_A + 1khz.
+                   int m = vfo[active_receiver->id].mode;
+                   if ((m == modeLSB) || (m == modeUSB)) {
+                       local_set_frequency(VFO_B, vfo[VFO_A].frequency + 5000);
+                   } else if ((m == modeCWL) || (m == modeCWU)) {
+                       local_set_frequency(VFO_B, vfo[VFO_A].frequency + 1000);
+                   }
+               }
                 tx_set_mode(transmitter, get_tx_mode());
                 vfo_update();
             }