Main Page   Modules   Data Structures   File List   Globals  

Event Handling


Modules

Internal Event Handling Functions

Functions

void otosSendEvent (OtosTask *pTask, uint16_t events)
 Send event(s) to one or more tasks. If a task waits for them, wake it.

uint8_t otosReceiveEvent (uint16_t events, uint32_t timeout)
 Receive events.


Detailed Description

Event Handling

Function Documentation

uint8_t otosReceiveEvent uint16_t    events,
uint32_t    timeout
 

Receive events.

If the events were already received, the function returns immediately. Else it waits the number of otOS timer ticks specified with timeout. If timeout is 0, the function returns immediately, which allows polling for events. If timeout is INFINITE then the function will wait for ever for the events.

Parameters:
events Events to receive
timeout Number of otOS timer ticks to wait for the events
  • 0: Don't wait
  • INFINITE: Wait infinitely
  • else: Wait number of ticks
Returns:
  • EVENT_SUCCESS: The events were received
  • EVENT_NOT_RECEIVED: The events were not received
  • EVENT_TIMEOUT: Timeout expired while waiting for events

Definition at line 170 of file event.c.

References g_pRunningTask, and otosBlock.

void otosSendEvent OtosTask *    pTask,
uint16_t    events
 

Send event(s) to one or more tasks. If a task waits for them, wake it.

Note:
When called from an interrupt service routine, the scheduler is NOT called after sending the events. It will be called at the next system tick. If you want the scheduler to be called as fast as possible, call otosInterruptReturn() at the end of the ISR.
Parameters:
pTask Task to send the events to. If NULL, the events are sent to all tasks in the system.
events Event(s) to send

Definition at line 66 of file event.c.

References g_pBlockedQueue, g_performDispatch, g_pReadyQueue, otosScheduler(), and otosSendEventToOneTask().


Generated on Sat Jan 25 18:41:43 2003 for otOS by doxygen1.3-rc2