Is the CW fix time-stamping the key closures in the interrupt handlers? ?If not, you will miss dits, as the code can't tell which key closed first, or if it missed a key closure, via polling of a global variable from a process running on a preemptive non-real-time kernel on a single core processor. ?Every time the Linux OS process dispatcher ticks, your code will have very long gaps in its polling loop. ?With IO pin time stamps, the code has enough information available to see whether it handled that time stamped event or not, and in the correct order. ?Making it much harder to miss dits.
?
The other way to solve the problem might be a hardware change. ?Poll the key inputs with one of the Pi Pico state machines, and have the Pico generate the dot dash timing.
?
73, Ron, n6ywu