Is the Teensy Arduino library threadsafe? If not, you would need to keep all your Arduino code in a single thread and use other threads for processing, using proper synchronisation primitives.
I usually do my initial circuit design using ICircuit, which can have a programmable Arduino as part of the circuit. It’s not a teensy so lacks the peripherals and performance, but allows good prototyping before...