From: c vw <dl1ycf@darc.de>
Date: Wed, 24 Feb 2021 15:21:08 +0000 (+0100)
Subject: MIDI_ACTION_CWKEY works if compiled without LOCALCW
X-Git-Url: https://git.rkrishnan.org/components/module-simplejson.encoder.html?a=commitdiff_plain;h=4e5f75458d0840097e021cc41d81dbe85a29565f;p=pihpsdr.git

MIDI_ACTION_CWKEY works if compiled without LOCALCW
---

diff --git a/midi3.c b/midi3.c
index 751bd20..0a598fd 100644
--- 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"