I was wondering if any of you would know some links to learn more about OS tasks and semaphores (more or less concerning uC/OS-II realtime kernel. I want to create a task which I could start by posting a semaphore.
In theory this is what I am after:
I would, ofcourse, write functions os_semaphore_pend() and os_semaphore_post() myself to add some own checks in it.
static int foo_Task( void );
static os_event *foo_Task_Sem;
int StartFooTask( void );
foo_Task(); // OSTaskCreate() should be called instead of calling the function?
os_semaphore_pend( foo_Task_Sem );
// Do the task here
int StartFooTask( void )
os_semaphore_post( foo_Task_Sem );
Anyway, above code does not work, since code execution will end up in forever loop in foo_Task() function.
I read about OSTaskCreate() and I figure that's what I need to call to create a task which would be foo_Task() then. Am I right? Will OSTaskCreate() actually call the function and leave it running behind? (that's how I understood it).
I would really appreciate some help or any information about resources / links to details about OS tasks and semaphores.