ABSTRACT
OS_CPU_SR cpu_sr; (1)
#endif
OS_EVENT *pevent;
if (OSIntNesting > 0) { (2)
return ((OS_EVENT *)0);
}
OS_ENTER_CRITICAL();
pevent = OSEventFreeList; (3)
if (OSEventFreeList != (OS_EVENT *)0) { (4)
OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr; (5)
}
Task
ISR
L7.1(1) A local variable called cpu_sr to support OS_CRITICAL_METHOD #3 is allocated. L7.1(2) OSSemCreate() starts by making sure you are not calling this function from an ISR because
this is not allowed. All kernel objects need to be created from task-level code or before multitasking starts.