Page 1 of 1

crazyflie task priorities

Posted: Tue May 09, 2017 2:52 am
by wenlong
In the file config.h, task priorities were set. but some tasks had the same priority such as STABILIZER_TASK_PRI was 4 and so the SENSORS_TASK_PRI, why did not set different priority, for example, the STABILIZER_TASK_PRI was 5 and SENSORS_TASK_PRI was 4?
Thanks

Re: crazyflie task priorities

Posted: Tue May 09, 2017 6:57 am
by arnaud
FreeRTOS allows us to have multiple tasks set with the same priority, in that case the tasks will be scheduled in round-robin.

Stabilizer and sensor tasks share the highest priority but there is no preference as of which one is more critical: each must be served regularity in order to fly, this is why they ended-up on the same priority level.

As a side note: adding priority level in FreeRTOS adds a bit of RAM consumption so it it was good for Crazyflie 1.0 to limit the number of priority level.

Re: crazyflie task priorities

Posted: Tue May 23, 2017 2:42 am
by wenlong
Thanks arnaud for your such clear answer!