void Task1(){ while(1){ printf("I am task 1\n"); //wait Sleep(1000);//1 sec //stop the task waitTask(); } }
void Task1(){ while(1){ printf("I am task 1\n"); //wait #ifdef __WIN32 Sleep(1000);//1 sec #endif /* __WIN32 */ #ifdef __unix__ sleep(1);//1 sec #endif /* __unix__ */ //stop the task waitTask(); } }
void Task2(){ static int dummy2=0; while(1){ printf("I am task 2 dummy2=%i\n", dummy2); //wait #ifdef __WIN32 Sleep(1000);//1 sec #endif /* __WIN32 */ #ifdef __unix__ sleep(1);//1 sec #endif /* __unix__ */ dummy2++; /* //start the task startTask(TaskId_1);*/ //stop the task waitTask(); } }