CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

queue.c File Reference

queue.c File Reference

Queue management implementation code of CooCox CoOS kernel. More...

Go to the source code of this file.

Functions

OS_EventID CoCreateQueue (void **qStart, U16 size, U8 sortType)
 Create a queue.
StatusType CoDelQueue (OS_EventID id, U8 opt)
 Delete a queue.
void * CoAcceptQueueMail (OS_EventID id, StatusType *perr)
 Accept a mail from queue.
void * CoPendQueueMail (OS_EventID id, U32 timeout, StatusType *perr)
 Pend for a mail.
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.

Variables

QCB QueueTbl [CFG_MAX_QUEUE] = {{0}}
U32 QueueIDVessel = 0

Detailed Description

Queue management implementation code of CooCox CoOS kernel.

Version:
V1.1.4
Date:
2011.04.20

INTERNAL FILE,DON'T PUBLIC.

© COPYRIGHT 2009 CooCox

Definition in file queue.c.


Function Documentation

void* CoAcceptQueueMail ( OS_EventID  id,
StatusType *  perr 
)

Accept a mail from queue.

Parameters:
[in]idEvent ID.
[out]perrA pointer to error code.
Return values:
Co_NULL
Apointer to mail accepted.
Description

This function is called to accept a mail from queue.

Note:

Definition at line 151 of file queue.c.

OS_EventID CoCreateQueue ( void **  qStart,
U16  size,
U8  sortType 
)

Create a queue.

Parameters:
[in]qStartPointer to mail pointer buffer.
[in]sizeThe length of queue.
[in]sortTypeMail queue waiting list sort type.
[out]None
Return values:
E_CREATE_FAILCreate queue fail.
othersCreate queue successful.
Description

This function is called to create a queue.

Note:

Definition at line 42 of file queue.c.

StatusType CoDelQueue ( OS_EventID  id,
U8  opt 
)

Delete a queue.

Parameters:
[in]idEvent ID.
[in]optDelete option.
[out]None
Return values:
E_INVALID_IDInvalid event ID.
E_INVALID_PARAMETERInvalid parameter.
E_TASK_WAITTINGTasks waitting for the event,delete fail.
E_OKEvent deleted successful.
Description

This function is called to delete a queue.

Note:

Definition at line 102 of file queue.c.

void* CoPendQueueMail ( OS_EventID  id,
U32  timeout,
StatusType *  perr 
)

Pend for a mail.

Parameters:
[in]idEvent ID.
[in]timeoutThe longest time for writting mail.
[out]perrA pointer to error code.
Return values:
Co_NULL
Apointer to mail accept.
Description

This function is called to wait for a mail.

Note:

Definition at line 212 of file queue.c.

StatusType CoPostQueueMail ( OS_EventID  id,
void *  pmail 
)

Post a mail to queue.

Parameters:
[in]idEvent ID.
[in]pmailPointer to mail that want to send.
[out]None
Return values:
E_OK
E_INVALID_ID
E_QUEUE_FULL
Description

This function is called to post a mail to queue.

Note:

Definition at line 316 of file queue.c.

StatusType isr_PostQueueMail ( OS_EventID  id,
void *  pmail 
)

Post a mail to queue in ISR.

Parameters:
[in]idEvent ID.
[in]pmailPointer to mail that want to send.
[out]None
Return values:
E_OK
E_INVALID_ID
E_QUEUE_FULL
Description

This function is called in ISR to post a mail to queue.

Note:

Definition at line 372 of file queue.c.


Variable Documentation

U32 QueueIDVessel = 0

Queue list mask

Definition at line 23 of file queue.c.

QCB QueueTbl[CFG_MAX_QUEUE] = {{0}}

Queue control block table

Definition at line 22 of file queue.c.