2022-04-19 12:02 PM
Using the while(1) with no timer seems like the simplest implementation and does not require a timer. Does using osDelay(10) inside a while(1) use more CPU than using software/hardware timer interrupt?
2022-04-20 03:40 AM
osDelay is RTOS aware, see https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e.
It does not use substantially more CPU cycles than the other methods.
The accuracy of the delay depends on all tasks priorities.
I see no issues with using osDelay for that purpose.
hth
KnarfB
2022-04-20 10:47 AM
Thanks for the info. I'll use osDelay for now. I'm going with a freeRTOS task with osDelay loop. This frees-up a hardware timer and its interrupt overhead, but still tempted to use a freeRTOS software timer. Not sure if the software timer or osDelay has less overhead. I'm not sure yet what method is best, and will try to weigh pros/cons. Might be splitting hairs but the fewer CPU cycles the better!