]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
MIDI_ACTION_CWKEY works if compiled without LOCALCW
authorc vw <dl1ycf@darc.de>
Wed, 24 Feb 2021 15:21:08 +0000 (16:21 +0100)
committerc vw <dl1ycf@darc.de>
Wed, 24 Feb 2021 15:21:08 +0000 (16:21 +0100)
midi3.c

diff --git a/midi3.c b/midi3.c
index 751bd20f3c467cd7c5fdc29234aa9f507404c2d2..0a598fd6a533ec452b5e422eac632ec0c147365a 100644 (file)
--- a/midi3.c
+++ b/midi3.c
@@ -229,14 +229,18 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) {
          // NO BREAK-IN! The keyer has to take care of sending MIDI PTT
          // on/off messages at appropriate times.
           //
-#ifdef LOCALCW
+          // Since this if for immediate key-down, it does not rely on LOCALCW
+          //
            if (type == MIDI_TYPE_KEY) {
-              keyer_straight_key(val);
+              if (val != 0) {
+                cw_key_down=960000;  // max. 20 sec to protect hardware
+                cw_key_up=0;
+                cw_key_hit=1;
+              } else {
+                cw_key_down=0;
+                cw_key_up=0;
+              }
             }
-#else
-           g_print("%s: CWKEY:%d\n",__FUNCTION__,val);
-
-#endif
            break;
        /////////////////////////////////////////////////////////// "CWL"
        /////////////////////////////////////////////////////////// "CWR"