With Anthony' move to isr reading the key/paddle hardware,we can move to almost real-time. Here is how:
1. His ISR sets a flag.
2. Our audio loop in tx_process or rx_process can check the flag very inexpesnively and sharp moving the envelope up or down.?
Btw, note that the shaping is a perfect raised cosine and you can vary the rise/fall time from the code. Anthony, you can probably add that command to the codebase.
The sound loop runs at the highest thread priority and we should not do anything it in expect the dsp stuff. At least not inside the rx_process and tx_process.
On Tue, Oct 4, 2022, 6:58 AM Evan Hand <elhandjr@...> wrote:
In my past, with process control, these problems were solved by having Fast, Slow, and maybe medium speed loops based on a timer interrupt.? That ensures the fast loop is executed on a minimum cycle time, and any extra process capability is used to process the other loops.? The priority is self-evident.? This gives predictability (determinism) for things like high-speed digital and PID control that need either a fast response or deterministic responses.? Using time stamping is a way to improve deterministic response capabilities.? You still need to manage the process timing to ensure that all functions can be performed in the time required.? My way of thinking is using the RPi to implement 2 or three Nano equivalents with loop executions that are fast enough to do what is required.