CooCox 1.1.4 on mbed with simple blinky example
CoOS.h File Reference
API header file of CooCox CoOS. More...
Go to the source code of this file.
Functions | |
void | CoInitOS (void) |
Initialize OS. | |
void | CoStartOS (void) |
Start multitask. | |
void | CoEnterISR (void) |
Enter a ISR. | |
void | CoExitISR (void) |
Exit a ISR. | |
void | CoSchedLock (void) |
Lock schedule. | |
void | CoSchedUnlock (void) |
Unlock schedule. | |
OS_VER | CoGetOSVersion (void) |
Get OS version. | |
void | CoExitTask (void) |
Exit Task. | |
OS_TID | CoGetCurTaskID (void) |
Get current task id. | |
StatusType | CoDelTask (OS_TID taskID) |
Delete Task. | |
StatusType | CoActivateTask (OS_TID taskID, void *argv) |
Activate Task. | |
StatusType | CoAwakeTask (OS_TID taskID) |
Awake Task. | |
StatusType | CoSuspendTask (OS_TID taskID) |
Suspend Task. | |
StatusType | CoSetPriority (OS_TID taskID, U8 priority) |
Change task priority. | |
OS_TID | CreateTask (FUNCPtr task, void *argv, U32 parameter, OS_STK *stk) |
Create a task. | |
U64 | CoGetOSTime (void) |
Get current ticks. | |
StatusType | CoTickDelay (U32 ticks) |
Delay current task for specify ticks number. | |
StatusType | CoResetTaskDelayTick (OS_TID taskID, U32 ticks) |
Reset task delay ticks. | |
StatusType | CoTimeDelay (U8 hour, U8 minute, U8 sec, U16 millsec) |
Delay current task for detail time. | |
StatusType | CoDelTmr (OS_TCID tmrID) |
Delete a timer. | |
StatusType | CoStopTmr (OS_TCID tmrID) |
Stop countering for a spcify timer. | |
StatusType | CoStartTmr (OS_TCID tmrID) |
Start counter. | |
U32 | CoGetCurTmrCnt (OS_TCID tmrID, StatusType *perr) |
Get current counter of specify timer. | |
StatusType | CoSetTmrCnt (OS_TCID tmrID, U32 tmrCnt, U32 tmrReload) |
Setting for a specify timer. | |
OS_TCID | CoCreateTmr (U8 tmrType, U32 tmrCnt, U32 tmrReload, vFUNCPtr func) |
Create a timer. | |
void * | CoKmalloc (U32 size) |
Allocation size bytes of memory block from kernel heap. | |
void | CoKfree (void *memBuf) |
Release memory block to kernel heap. | |
void * | CoGetMemoryBuffer (OS_MMID mmID) |
Get a memory buffer from memory partition. | |
StatusType | CoDelMemoryPartition (OS_MMID mmID) |
Delete a memory partition. | |
StatusType | CoFreeMemoryBuffer (OS_MMID mmID, void *buf) |
Free a memory buffer to memory partition. | |
U32 | CoGetFreeBlockNum (OS_MMID mmID, StatusType *perr) |
Get free block number in a memory partition. | |
OS_MMID | CoCreateMemPartition (U8 *memBuf, U32 blockSize, U32 blockNum) |
Create a memory partition. | |
OS_MutexID | CoCreateMutex (void) |
Create a mutex. | |
StatusType | CoEnterMutexSection (OS_MutexID mutexID) |
Enter a critical area. | |
StatusType | CoLeaveMutexSection (OS_MutexID mutexID) |
Leave from a critical area. | |
StatusType | CoPostSem (OS_EventID id) |
Post a semaphore. | |
StatusType | CoAcceptSem (OS_EventID id) |
Accept a semaphore without waitting. | |
StatusType | isr_PostSem (OS_EventID id) |
Post a semaphore in ISR. | |
StatusType | CoDelSem (OS_EventID id, U8 opt) |
Delete a semaphore. | |
StatusType | CoPendSem (OS_EventID id, U32 timeout) |
wait for a semaphore | |
OS_EventID | CoCreateSem (U16 initCnt, U16 maxCnt, U8 sortType) |
Create a semaphore. | |
OS_EventID | CoCreateMbox (U8 sortType) |
Create a mailbox. | |
StatusType | CoDelMbox (OS_EventID id, U8 opt) |
Delete a mailbox. | |
StatusType | CoPostMail (OS_EventID id, void *pmail) |
Post a mailbox. | |
StatusType | isr_PostMail (OS_EventID id, void *pmail) |
Post a mailbox in ISR. | |
void * | CoAcceptMail (OS_EventID id, StatusType *perr) |
Accept a mailbox. | |
void * | CoPendMail (OS_EventID id, U32 timeout, StatusType *perr) |
Wait for a mailbox. | |
StatusType | CoDelQueue (OS_EventID id, U8 opt) |
Delete a queue. | |
StatusType | CoPostQueueMail (OS_EventID id, void *pmail) |
Post a mail to queue. | |
StatusType | isr_PostQueueMail (OS_EventID id, void *pmail) |
Post a mail to queue in ISR. | |
void * | CoAcceptQueueMail (OS_EventID id, StatusType *perr) |
Accept a mail from queue. | |
OS_EventID | CoCreateQueue (void **qStart, U16 size, U8 sortType) |
Create a queue. | |
void * | CoPendQueueMail (OS_EventID id, U32 timeout, StatusType *perr) |
Pend for a mail. | |
StatusType | CoSetFlag (OS_FlagID id) |
Set a flag. | |
StatusType | CoClearFlag (OS_FlagID id) |
Clear a Flag. | |
StatusType | isr_SetFlag (OS_FlagID id) |
Set a flag in ISR. | |
StatusType | CoDelFlag (OS_FlagID id, U8 opt) |
Delete a flag. | |
StatusType | CoAcceptSingleFlag (OS_FlagID id) |
AcceptSingleFlag. | |
StatusType | CoWaitForSingleFlag (OS_FlagID id, U32 timeout) |
WaitForSingleFlag. | |
OS_FlagID | CoCreateFlag (BOOL bAutoReset, BOOL bInitialState) |
Create a flag. | |
U32 | CoAcceptMultipleFlags (U32 flags, U8 waitType, StatusType *perr) |
AcceptMultipleFlags. | |
U32 | CoWaitForMultipleFlags (U32 flags, U8 waitType, U32 timeout, StatusType *perr) |
WaitForMultipleFlags. | |
StatusType | CoTimeToTick (U8 hour, U8 minute, U8 sec, U16 millsec, U32 *ticks) |
Convert time to tick. | |
void | CoTickToTime (U32 ticks, U8 *hour, U8 *minute, U8 *sec, U16 *millsec) |
Convert tick number to time. | |
void | CoIdleTask (void *pdata) |
IDLE task of OS. | |
void | CoStkOverflowHook (OS_TID taskID) |
Hook for stack overflow. |
Detailed Description
API header file of CooCox CoOS.
- Version:
- V1.1.4
- Date:
- 2011.04.20
This file including all API functions's declare of CooCox CoOS.
INTERNAL FILE,DON'T PUBLIC.
© COPYRIGHT 2009 CooCox
Definition in file CoOS.h.
Function Documentation
void* CoAcceptMail | ( | OS_EventID | id, |
StatusType * | perr | ||
) |
U32 CoAcceptMultipleFlags | ( | U32 | flags, |
U8 | waitType, | ||
StatusType * | perr | ||
) |
void* CoAcceptQueueMail | ( | OS_EventID | id, |
StatusType * | perr | ||
) |
StatusType CoAcceptSem | ( | OS_EventID | id ) |
StatusType CoAcceptSingleFlag | ( | OS_FlagID | id ) |
StatusType CoActivateTask | ( | OS_TID | taskID, |
void * | argv | ||
) |
StatusType CoAwakeTask | ( | OS_TID | taskID ) |
Awake Task.
- Parameters:
-
[in] taskID ID of task that will been awaked. [out] None
- Return values:
-
E_OK Task awake successful. E_INVALID_ID Invalid task ID. E_TASK_NOT_WAITING Task now not in waiting state. E_TASK_WAIT_OTHER Task now waiting other awake event. E_PROTECTED_TASK Idle task mustn't be awaked.
- Description
This function is called to awake current task.
StatusType CoClearFlag | ( | OS_FlagID | id ) |
OS_FlagID CoCreateFlag | ( | BOOL | bAutoReset, |
BOOL | bInitialState | ||
) |
Create a flag.
- Parameters:
-
[in] bAutoReset Reset mode,Co_TRUE(Auto Reset) FLASE(Manual Reset). [in] bInitialState Initial state. [out] None
- Return values:
-
E_CREATE_FAIL Create flag fail. others Create flag successful.
- Description
This function use to create a event flag.
- Note:
OS_EventID CoCreateMbox | ( | U8 | sortType ) |
OS_MMID CoCreateMemPartition | ( | U8 * | memBuf, |
U32 | blockSize, | ||
U32 | blockNum | ||
) |
Create a memory partition.
- Parameters:
-
[in] memBuf Specify memory partition head address. [in] blockSize Specify memory block size. [in] blockNum Specify memory block number. [out] None
- Return values:
-
E_CREATE_FAIL Create memory partition fail. others Create memory partition successful.
- Description
This function is called to create a memory partition.
OS_MutexID CoCreateMutex | ( | void | ) |
OS_EventID CoCreateQueue | ( | void ** | qStart, |
U16 | size, | ||
U8 | sortType | ||
) |
Create a queue.
- Parameters:
-
[in] qStart Pointer to mail pointer buffer. [in] size The length of queue. [in] sortType Mail queue waiting list sort type. [out] None
- Return values:
-
E_CREATE_FAIL Create queue fail. others Create queue successful.
- Description
This function is called to create a queue.
- Note:
OS_EventID CoCreateSem | ( | U16 | initCnt, |
U16 | maxCnt, | ||
U8 | sortType | ||
) |
Create a semaphore.
- Parameters:
-
[in] initCnt Semaphore valid counter. [in] maxCnt Semaphore max initialize counter. [in] sortType Semaphore sort type. [out] None
- Return values:
-
E_CREATE_FAIL Create semaphore fail. others Create semaphore successful.
- Description
This function is called to create a semaphore.
OS_TCID CoCreateTmr | ( | U8 | tmrType, |
U32 | tmrCnt, | ||
U32 | tmrReload, | ||
vFUNCPtr | func | ||
) |
Create a timer.
- Parameters:
-
[in] tmrType Specify timer's type. [in] tmrCnt Specify timer initial counter value. [in] tmrReload Specify timer reload value. [in] func Specify timer callback function entry. [out] None
- Return values:
-
E_CREATE_FAIL Create timer fail. others Create timer successful.
- Description
This function is called to create a timer.
StatusType CoDelFlag | ( | OS_FlagID | id, |
U8 | opt | ||
) |
Delete a flag.
- Parameters:
-
[in] id Flag ID. [in] opt Delete option. [out] None
- Return values:
-
E_CALL Error call in ISR. E_INVALID_ID Invalid event ID. E_TASK_WAITTING Tasks waitting for the event,delete fail. E_OK Event deleted successful.
- Description
This function is called to delete a event flag.
- Note:
StatusType CoDelMbox | ( | OS_EventID | id, |
U8 | opt | ||
) |
Delete a mailbox.
- Parameters:
-
[in] id Event ID. [in] opt Delete option. [out] None
- Return values:
-
E_INVALID_ID Invalid event ID. E_INVALID_PARAMETER Invalid parameter. E_TASK_WAITTING Tasks waitting for the event,delete fail. E_OK Event deleted successful.
- Description
This function is called to delete a mailbox.
- Note:
StatusType CoDelMemoryPartition | ( | OS_MMID | mmID ) |
Delete a memory partition.
- Parameters:
-
[in] mmID Specify memory partition that want to delete. [out] None
- Return values:
-
E_INVALID_ID The memory partition id passed was invalid,delete fail. E_OK Delete successful.
- Description
This function is called to Delete a memory partition.
StatusType CoDelQueue | ( | OS_EventID | id, |
U8 | opt | ||
) |
Delete a queue.
- Parameters:
-
[in] id Event ID. [in] opt Delete option. [out] None
- Return values:
-
E_INVALID_ID Invalid event ID. E_INVALID_PARAMETER Invalid parameter. E_TASK_WAITTING Tasks waitting for the event,delete fail. E_OK Event deleted successful.
- Description
This function is called to delete a queue.
- Note:
StatusType CoDelSem | ( | OS_EventID | id, |
U8 | opt | ||
) |
Delete a semaphore.
- Parameters:
-
[in] id Event ID which to be deleted. [in] opt Delete option. - == OPT_DEL_ANYWAY Delete semaphore always
- == OPT_DEL_NO_PEND Delete semaphore only when no task pending on.
[out] None
- Return values:
-
E_INVALID_ID Invalid event ID. E_INVALID_PARAMETER Invalid parameter. E_TASK_WAITTING Tasks waitting for the event,delete fail. E_OK Event deleted successful.
- Description
This function is called to delete a semaphore.
- Note:
StatusType CoDelTask | ( | OS_TID | taskID ) |
StatusType CoDelTmr | ( | OS_TCID | tmrID ) |
Delete a timer.
- Parameters:
-
[in] tmrID Specify a timer which deleted. [out] None
- Return values:
-
E_INVALID_ID The timer id passed was invalid,deleted failure. E_OK Delete a timer successful.
- Description
This function is called to delete a timer which created before.
void CoEnterISR | ( | void | ) |
Enter a ISR.
Enter a ISR
- Parameters:
-
[in] None [out] None
- Return values:
-
None
- Description
This function is called to notify OS when enter to an ISR.
- Note:
- When you call API in ISR,you must call CoEnterISR() before your interrupt handler code,and call CoExitISR() after your handler code and before exiting from ISR.
StatusType CoEnterMutexSection | ( | OS_MutexID | mutexID ) |
void CoExitISR | ( | void | ) |
void CoExitTask | ( | void | ) |
StatusType CoFreeMemoryBuffer | ( | OS_MMID | mmID, |
void * | buf | ||
) |
Free a memory buffer to memory partition.
- Parameters:
-
[in] mmID Specify memory partition. [in] buf Specify memory buffer that want to free. [out] None
- Return values:
-
E_INVALID_ID The memory partition id passed was invalid. E_INVALID_PARAMETER The parameter passed was invalid. E_OK Free successful.
- Description
This function is called to Delete a memory partition.
OS_TID CoGetCurTaskID | ( | void | ) |
U32 CoGetCurTmrCnt | ( | OS_TCID | tmrID, |
StatusType * | perr | ||
) |
Get current counter of specify timer.
- Parameters:
-
[in] tmrID Specify timer by ID. [out] E_INVALID_ID Invalid ID was passed and get counter failure. [out] E_OK Get current counter successful.
- Return values:
-
Current counter of a timer which specify by id.
- Description
This function is called to obtain current counter of specify timer.
U32 CoGetFreeBlockNum | ( | OS_MMID | mmID, |
StatusType * | perr | ||
) |
Get free block number in a memory partition.
- Parameters:
-
[in] mmID Specify memory partition. [out] E_INVALID_ID Invalid ID was passed and get counter failure. [out] E_OK Get current counter successful.
- Return values:
-
fbNum The number of free block.
- Description
This function is called to get free block number in a memory partition.
void* CoGetMemoryBuffer | ( | OS_MMID | mmID ) |
Get a memory buffer from memory partition.
- Parameters:
-
[in] mmID Specify memory partition that want to assign buffer. [out] None
- Return values:
-
Co_NULL Assign buffer fail. others Assign buffer successful,and return the buffer pointer.
- Description
This function is called to Delete a memory partition.
U64 CoGetOSTime | ( | void | ) |
OS_VER CoGetOSVersion | ( | void | ) |
Get OS version.
Get OS version value
- Parameters:
-
[in] None [out] None
- Return values:
-
The value is version of OS mutipled by 100.
- Description
This function is used to return the version number of CooCox OS. the return value corresponds to CooCox's version number multiplied by 100. In other words, version 1.02 would be returned as 102.
void CoIdleTask | ( | void * | pdata ) |
void CoInitOS | ( | void | ) |
Initialize OS.
Initialize OS
- Parameters:
-
[in] None [out] None
- Return values:
-
None
- Description
This function is called to initialize OS.
- Note:
- You must call this function first,before any other OS API function
There is a example for useage of this function,as follows: e.g. ... // Your target initial code. OsInit(); // Initial OS. CreateTask(...); // Create tasks. ... OsStart(); // Start multitask.
void CoKfree | ( | void * | memBuf ) |
Release memory block to kernel heap.
- Parameters:
-
[in] memBuf Pointer to memory block. [out] None
- Return values:
-
None
- Description
This function is called to release memory block.
Definition at line 182 of file kernelHeap.c.
void* CoKmalloc | ( | U32 | size ) |
Allocation size bytes of memory block from kernel heap.
- Parameters:
-
[in] size Length of menory block. [out] None
- Return values:
-
Co_NULL Allocate fail. others Pointer to memory block.
- Description
This function is called to allocation size bytes of memory block.
Definition at line 64 of file kernelHeap.c.
StatusType CoLeaveMutexSection | ( | OS_MutexID | mutexID ) |
Leave from a critical area.
- Parameters:
-
[in] mutexID Specify mutex id. [out] None
- Return values:
-
E_INVALID_ID Invalid mutex id. E_CALL Error call in ISR. E_OK Exit a critical area successful.
- Description
This function must be called when exiting from a critical area.
- Note:
void* CoPendMail | ( | OS_EventID | id, |
U32 | timeout, | ||
StatusType * | perr | ||
) |
void* CoPendQueueMail | ( | OS_EventID | id, |
U32 | timeout, | ||
StatusType * | perr | ||
) |
StatusType CoPendSem | ( | OS_EventID | id, |
U32 | timeout | ||
) |
wait for a semaphore
- Parameters:
-
[in] id Event ID. [in] timeout The longest time for writting semaphore. 0 0x1~0xff [out] None
- Return values:
-
E_CALL Error call in ISR. E_INVALID_ID Invalid event ID. E_TIMEOUT Semaphore was not received within the specified 'timeout' time. E_OK The call was successful and your task owns the resource,or the event you are waiting for occurred.
- Description
This function is called to waits for a semaphore.
- Note:
- IF this function is called in ISR,nothing to do and return immediately.
StatusType CoPostMail | ( | OS_EventID | id, |
void * | pmail | ||
) |
StatusType CoPostQueueMail | ( | OS_EventID | id, |
void * | pmail | ||
) |
StatusType CoPostSem | ( | OS_EventID | id ) |
Post a semaphore.
- Parameters:
-
[in] id id of event control block associated with the desired semaphore. [out] None
- Return values:
-
E_INVALID_ID Parameter id passed was invalid event ID. E_SEM_FULL Semaphore full. E_OK Semaphore had post successful.
- Description
This function is called to post a semaphore to corresponding event.
- Note:
StatusType CoResetTaskDelayTick | ( | OS_TID | taskID, |
U32 | ticks | ||
) |
Reset task delay ticks.
- Parameters:
-
[in] ptcb Task that want to insert into DELAY list. [in] ticks Specify system tick number which will delay . [out] None
- Return values:
-
E_CALL Error call in ISR. E_INVALID_ID Invalid task id. E_NOT_IN_DELAY_LIST Task not in delay list. E_OK The current task was inserted to DELAY list successful,it will delay for specify time.
- Description
This function delay specify ticks for current task.
void CoSchedLock | ( | void | ) |
void CoSchedUnlock | ( | void | ) |
StatusType CoSetFlag | ( | OS_FlagID | id ) |
StatusType CoSetPriority | ( | OS_TID | taskID, |
U8 | priority | ||
) |
Change task priority.
- Parameters:
-
[in] taskID Specify task id. [in] priority New priority. [out] None
- Return values:
-
E_OK Change priority successful. E_INVALID_ID Invalid id,change priority fail. E_PROTECTED_TASK Can't change idle task priority.
- Description
This function is called to change priority for a specify task.
StatusType CoSetTmrCnt | ( | OS_TCID | tmrID, |
U32 | tmrCnt, | ||
U32 | tmrReload | ||
) |
Setting for a specify timer.
- Parameters:
-
[in] tmrID Specify timer by ID. [in] tmrCnt Specify timer counter which need to be set. [in] tmrReload Specify timer reload value which need to be set. [out] None
- Return values:
-
E_INVALID_ID The ID passed was invalid,set fail. E_OK Set timer counter successful.
- Description
This function is called to set timer counter and reload value.
void CoStartOS | ( | void | ) |
Start multitask.
Start multitask
- Parameters:
-
[in] None [out] None
- Return values:
-
None
- Description
This function is called to start multitask.After it is called, OS start schedule task by priority or/and time slice.
- Note:
- This function must be called to start OS when you use CoOS,and must call after CoOsInit().
StatusType CoStartTmr | ( | OS_TCID | tmrID ) |
Start counter.
- Parameters:
-
[in] tmrID Specify a timer which startted. [out] None
- Return values:
-
E_INVALID_ID The timer id passed was invalid,can't start timer E_OK Insert a timer to timer list and start it successful.
- Description
This function is called to make a timer start countering.
void CoStkOverflowHook | ( | OS_TID | taskID ) |
StatusType CoStopTmr | ( | OS_TCID | tmrID ) |
Stop countering for a spcify timer.
- Parameters:
-
[in] tmrID Specify a timer which stopped. [out] None
- Return values:
-
E_INVALID_ID The timer id passed was invalid, stop failure. E_OK Stop a timer countering successful.
- Description
This function is called to stop a timer from counting.
StatusType CoSuspendTask | ( | OS_TID | taskID ) |
Suspend Task.
- Parameters:
-
[in] taskID ID of task that want to suspend. [out] None
- Return values:
-
E_OK Task suspend successful. E_INVALID_ID Invalid event ID. E_PROTECTED_TASK Can't suspend idle task. E_ALREADY_IN_WAITING Task now in waiting state.
- Description
This function is called to exit current task.
StatusType CoTickDelay | ( | U32 | ticks ) |
Delay current task for specify ticks number.
- Parameters:
-
[in] ticks Specify system tick number which will delay. [out] None
- Return values:
-
E_CALL Error call in ISR. E_OK The current task was insert to DELAY list successful,it will delay specify time.
- Description
This function delay specify ticks for current task.
- Note:
- This function be called in ISR,do nothing and return immediately.
void CoTickToTime | ( | U32 | ticks, |
U8 * | hour, | ||
U8 * | minute, | ||
U8 * | sec, | ||
U16 * | millsec | ||
) |
Convert tick number to time.
- Parameters:
-
[in] ticks Specifies the systerm tick numbers that will be converted. [out] hour Hours which converted. [out] minute minutes which converted. [out] sec seconds which converted. [out] millsec millseconds which converted.
- Return values:
-
None
- Description
This function is called to convert specify ticks to time format.
StatusType CoTimeDelay | ( | U8 | hour, |
U8 | minute, | ||
U8 | sec, | ||
U16 | millsec | ||
) |
Delay current task for detail time.
- Parameters:
-
[in] hour Specify the number of hours. [in] minute Specify the number of minutes. [in] sec Specify the number of seconds. [in] millsec Specify the number of millseconds. [out] None
- Return values:
-
E_CALL Error call in ISR. E_INVALID_PARAMETER Parameter passed was invalid,delay fail. E_OK The current task was inserted to DELAY list successful,it will delay for specify time.
- Description
This function delay specify time for current task.
- Note:
- If this function called in ISR,do nothing and return immediately.
StatusType CoTimeToTick | ( | U8 | hour, |
U8 | minute, | ||
U8 | sec, | ||
U16 | millsec, | ||
U32 * | ticks | ||
) |
Convert time to tick.
- Parameters:
-
[in] hour Specifies the number of hours. [in] minute Specifies the number of minutes. [in] sec Specifies the number of seconds. [in] millsec Specifies the number of millseconds. [out] ticks Tick numbers that converted.
- Return values:
-
E_INVALID_PARAMETER Invalid parameter be passed and convert fail. E_OK Convert successful.
- Description
This function is called to convert specify time to tick number.
U32 CoWaitForMultipleFlags | ( | U32 | flags, |
U8 | waitType, | ||
U32 | timeout, | ||
StatusType * | perr | ||
) |
WaitForMultipleFlags.
- Parameters:
-
[in] flags Flags that waiting to active task. [in] waitType Flags wait type. [in] timeout The longest time for writting flag. [out] perr A pointer to error code.
- Return values:
-
0 springFlag
- Description
This function is called to pend a task for waitting multiple flag.
- Note:
StatusType CoWaitForSingleFlag | ( | OS_FlagID | id, |
U32 | timeout | ||
) |
WaitForSingleFlag.
- Parameters:
-
[in] id Flag ID. [in] timeout The longest time for writting flag. [out] None
- Return values:
-
E_CALL Error call in ISR. E_INVALID_ID Invalid event ID. E_TIMEOUT Flag wasn't received within 'timeout' time. E_OK The call was successful and your task owns the Flag, or the event you are waiting for occurred.
- Description
This function is called to wait for only one flag, (1) if parameter "timeout" == 0,waiting until flag be set; (2) when "timeout" != 0,if flag was set or wasn't set but timeout occured,the task will exit the waiting list,convert to READY or RUNNING state.
- Note:
OS_TID CreateTask | ( | FUNCPtr | task, |
void * | argv, | ||
U32 | parameter, | ||
OS_STK * | stk | ||
) |
Create a task.
- Parameters:
-
[in] task Task code entry. [in] argv The parameter passed to task. [in] parameter Task priority + stack size + time slice + isWaitting. [in] stk Pointer to stack top of task. [out] None
- Return values:
-
E_CREATE_FAIL Fail to create a task . others Valid task id.
- Description
This function is called by application to create a task,return a id to mark this task.
StatusType isr_PostMail | ( | OS_EventID | id, |
void * | pmail | ||
) |
StatusType isr_PostQueueMail | ( | OS_EventID | id, |
void * | pmail | ||
) |
StatusType isr_PostSem | ( | OS_EventID | id ) |
Post a semaphore in ISR.
- Parameters:
-
[in] id identifier of event control block associated with the desired semaphore. [out] None
- Return values:
-
E_INVALID_ID Parameter id passed was invalid event ID. E_NO_TASK_WAITTING There are one more tasks waitting for the event. E_OK Semaphore had signaled successful.
- Description
This function is called in ISR to post a semaphore to corresponding event.
- Note:
Generated on Tue Jul 12 2022 18:19:10 by 1.7.2