CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

event.c File Reference

event.c File Reference

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

Go to the source code of this file.

Functions

void CreateEventList (void)
 Create a empty list of event control block.
static void ReleaseECB (P_ECB pecb)
 Release a ECB.
P_ECB CreatEvent (U8 eventType, U8 eventSortType, void *eventPtr)
 Create a event.
StatusType DeleteEvent (P_ECB pecb, U8 opt)
 Delete a event.
void EventTaskToWait (P_ECB pecb, P_OSTCB ptcb)
 Insert a task to event wait list.
void EventTaskToRdy (P_ECB pecb)
 Move a task from event WAITING list to the DELAY list.
void RemoveEventWaittingList (P_OSTCB ptcb)
 Move a task from event wait list to the ready list.

Variables

ECB EventTbl [CFG_MAX_EVENT] = {{0}}
P_ECB FreeEventList = 0

Detailed Description

event 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 event.c.


Function Documentation

void CreateEventList ( void   )

Create a empty list of event control block.

Parameters:
[in]None
[out]None
Return values:
None
Description

This function is called by OSInit() API to create a ECB list,supply a pointer to next event control block that not used.

Definition at line 40 of file event.c.

P_ECB CreatEvent ( U8  eventType,
U8  eventSortType,
void *  eventPtr 
)

Create a event.

Parameters:
[in]eventTypeThe type of event which being created.
[in]eventSortTypeEvent sort type.
[in]eventCounterEvent counter,ONLY for EVENT_TYPE_SEM.
[in]eventPtrEvent struct pointer,ONLY for Queue.Co_NULL for other event type.
[out]None
Return values:
Co_NULLInvalid pointer,create event fail.
othersPointer to event control block which had assigned right now.
Description

This function is called by CreateSem(),... to get a event control block and initial the event content.

Note:
This is a internal function of CooCox CoOS,User can't call.

Definition at line 117 of file event.c.

StatusType DeleteEvent ( P_ECB  pecb,
U8  opt 
)

Delete a event.

Parameters:
[in]pecbPointer to event control block which will be deleted.
[in]optDelete option.

  • == OPT_DEL_ANYWAY Delete event always
  • == OPT_DEL_NO_PEND Delete event only when no task pending on.
[out]None
Return values:
E_INVALID_PARAMETERParameter passed is invalid,deleted fail.
E_TASK_WAITTINGThese are one more tasks waitting event.
E_OKDelete event control block successful.
Description

This function is called to delete a event from the event wait list use specify option.

Note:
This is a internal function of Coocox CoOS,user can't call.

Definition at line 158 of file event.c.

void EventTaskToRdy ( P_ECB  pecb )

Move a task from event WAITING list to the DELAY list.

Parameters:
[in]pecbPointer to event control block corresponding to the event.
[out]None
Return values:
None
Description

This function is called to remove a task from event wait list,and then insert it into the READY list.

Definition at line 303 of file event.c.

void EventTaskToWait ( P_ECB  pecb,
P_OSTCB  ptcb 
)

Insert a task to event wait list.

Parameters:
[in]pecbPointer to event control block corresponding to the event.
[in]ptcbPointer to task that will be insert to event wait list.
[out]None
Return values:
None
Description

This function is called to insert a task by fllowing manner: opt == EVENT_SORT_TYPE_FIFO By FIFO. opt == EVENT_SORT_TYPE_PRIO By priority order,hghest priority as head,lowest priority as end. (Highest-->...-->Lowest-->Co_NULL)

Definition at line 213 of file event.c.

static void ReleaseECB ( P_ECB  pecb ) [static]

Release a ECB.

Parameters:
[in]pecbA pointer to event control block which be released.
[out]None
Return values:
None
Description

This function is called to release a event control block when a event be deleted.

Definition at line 87 of file event.c.

void RemoveEventWaittingList ( P_OSTCB  ptcb )

Move a task from event wait list to the ready list.

Parameters:
[in]pecbPointer to event control block corresponding to the event.
[out]None
Return values:
None
Description

This function is called to remove a task from event wait list,and then insert it to the ready list.

Definition at line 377 of file event.c.


Variable Documentation

ECB EventTbl[CFG_MAX_EVENT] = {{0}}

Table which save event control block.

Definition at line 24 of file event.c.

Pointer to free event control block.

Definition at line 25 of file event.c.