ch32-hal icon indicating copy to clipboard operation
ch32-hal copied to clipboard

Fast EXTI

Open Usioumeo opened this issue 2 months ago • 1 comments

Good morning. Firstly I would like to thank you for this great library. I'm implementing a motor driver using this lib as a foundation.

Now I have to read the encoder, which consist of 4 wires on which I have to listen to changes (fast changes. Like 40khz). Because of that I don't think the correct way to do this is to get 4 exti-input, await on any change, select them with futures::select and then read what actually changed. This approach is unstable because rely on embassy task executor, and from one CPU and another could elapse lots of cycles.

Another approach could be to use an embassy interrupt driven executor, but I think isn't supported for this architecture.

Another approach could be to override the exti interrupts handler(if it is possible). But with this I risk to break the other exti interrupts.

In the end I could even remove embassy and implement what I need from scratch, but of course it is one "reinvent thr wheel" approach.

Let me know if I haven't listed all approaches, or if there is one clear winner in your mind.

Keep on the great work👍

Usioumeo avatar May 20 '24 05:05 Usioumeo