Am I reinventing the wheel making my own non-blocking delay function?
As I use interrupts in my projects a lot, but not every event in the system generates hardware interrupt - I need to be able to wait for events but the waiting needs to be initialized with a hardware interrupt.
That means anything called by an interrupt handler can't spin-wait or it crash (or badly lag) the entire system. So - here's why.
I tried to google how to do it and found nothing useful. So I made my own function. It's in delay_async.c file of this gist:
https://gist.github.com/HTD/e36fb68488742f27a737a5d096170623
However, I wonder - isn't it a kind of reinventing the wheel? Doesn't STM32 HAL or IDK, maybe FreeRTOS have something virtually identical to what I made? I just can't find it. I committed that thing because I don't have time, I needed solution ASAP, but now I'm just curious, maybe it was already there and should be used instead?
