cancel
Showing results for 
Search instead for 
Did you mean: 

Calling osDelay from a function called inside a Task

VCasa.3
Associate II

Hello,

I have a doubdt and I haven't found the solution on the internet (probably I haven't asked properly or I have been missunderstood)

The thing is that I have a peripheral driver,with a function to write and read to and from SPI, and between them, I have a delay.

If I have a Task, and from this task I call that function, with the delay being osDelay(), will it work, as the normal behabiour of calling osDelay from the task itself (allowing other tasks to run during the delay).

Thank you so much!

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

osDelay() is the correct funtion for OS-aware delay.

https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__Wait.html

Doesn't matter if its called directly in the task loop or indirectly from a function in a task loop.

hth

KnarfB

View solution in original post

2 REPLIES 2
KnarfB
Principal III

osDelay() is the correct funtion for OS-aware delay.

https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__Wait.html

Doesn't matter if its called directly in the task loop or indirectly from a function in a task loop.

hth

KnarfB

VCasa.3
Associate II

Perfect, thank you!