I am an RTOS newbie and I am creating a simple real time system for automotive
I am wondering if it possible to create a task inside another task. I tried to do this by the following method but it doesn't work.
void vTask1 { *pvParameters){
unsigned portBASE_TYPE taskPriority;
taskPriority=uxTaskPriorityGet( NULL );
char x;
while (1){
x= 5 ;
if (x==5)
xTaskCreate( vTask2 , "task2", 1000, "task2 is running", taskPriority+5 , NULL );
}
when I debug that code it hangs at xTaskCreate without executing the new task and I searched the manual and the internet for something about this but I didn't find any.
would anyone tell me is that possible to do in RTOS or I am doing it in a wrong way?