-
Notifications
You must be signed in to change notification settings - Fork 14
Description
I see in several of your examples (e.g. Basic_RTOS_Example), you have comments and code such as quoted below. Can you please clarify the consequences of utilizing delay() and delayMicroseconds() functions?
//**************************************************************************
// Can use these function for RTOS delays
// Takes into account processor speed
// Use these instead of delay(...) in rtos tasks
//**************************************************************************
void myDelayUs(int us)
{
vTaskDelay( us / portTICK_PERIOD_US );
}
void myDelayMs(int ms)
{
vTaskDelay( (ms * 1000) / portTICK_PERIOD_US );
}
void myDelayMsUntil(TickType_t *previousWakeTime, int ms)
{
vTaskDelayUntil( previousWakeTime, (ms * 1000) / portTICK_PERIOD_US );
}
I'm currently using a SAMD51-based board for controlling multiple items simultaneously. The underlying libraries sometimes use the delay() and delayMicroseconds() functions. I thought that using an RTOS such as this would be an easy way to multitask, without worrying about when my underlying libraries use various delays, and even allowing me to use the obviously "blocking" functions as needed. But your examples suggest I'd have to dig into every library I'm using, and their dependencies; find every place they use delay/delayMicroseconds; fork those libraries; and modify them so I can injecting different delay functions. Which in turn has me questioning whether to bother with an RTOS at all.