vail-adapter

Firmware for USB morse code key adapter
git clone https://git.woozle.org/neale/vail-adapter.git

commit
9cd61a5
parent
7d84ec8
author
WrathPak
date
2025-08-18 15:44:23 -0600 MDT
Update keyers.cpp, revert for radio mode issue
1 files changed,  +3, -19
M keyers.cpp
+3, -19
 1@@ -1,7 +1,5 @@
 2-// keyers.cpp - FINAL VERSION
 3 #include <stddef.h>
 4 #include "keyers.h"
 5-#include "adapter.h" // <-- ADDED INCLUDE
 6 
 7 #define len(t) (sizeof(t)/sizeof(*t))
 8 
 9@@ -215,18 +213,6 @@ public:
10         } else {
11             int next = this->nextTx();
12             if (next >= 0) {
13-                // *** THIS IS THE CRITICAL FIX ***
14-                // Before we transmit, tell the adapter which element we are sending.
15-                if (this->output) {
16-                    VailAdapter* adapter = static_cast<VailAdapter*>(this->output);
17-                    if (next == PADDLE_DAH) {
18-                        adapter->activePaddle = 2; // 2 for DAH
19-                    } else {
20-                        adapter->activePaddle = 1; // 1 for DIT
21-                    }
22-                }
23-                // *** END OF FIX ***
24-
25                 nextPulse = this->keyDuration(next);
26                 this->Tx(0, true);
27             }
28@@ -414,15 +400,13 @@ Keyer *GetKeyerByNumber(int n, Transmitter *output) {
29     }
30 
31     Keyer *k = keyers[n];
32-	if (k) {
33-    	k->SetOutput(output);
34-	}
35+    k->SetOutput(output);
36     return k;
37 }
38 
39 int getKeyerNumber(Keyer* k) {
40     if (k == NULL) {
41-        return 0; // 0 is no keyer (passthrough)
42+        return 1; // Default to straight key if NULL
43     }
44     
45     for (int i = 1; i < len(keyers); i++) {
46@@ -430,5 +414,5 @@ int getKeyerNumber(Keyer* k) {
47             return i;
48         }
49     }
50-    return 0; // Default to passthrough if not found
51+    return 1; // Default to straight key if not found
52 }