This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Event module question

Hardware and software and tools details

TM4C series Micro-controller

TI-RTOS

CCS 6.0 TI ARM Compiler 5.1.6

gpio_isr()

{

event_post(gpioevent, Event_Id_00);

}

 gpiotask

{

while(1)

{
     if((Event_pend(gpioevent, Event_Id_NONE, Event_Id_00+Event_Id_01 , BIOS_WAIT_FOREVER)) & Event_Id_00 )

.....{  

   / do some thing /

    }

}

}

In the above code , whenever a button is pressed (GPIO) an event posted,  

The task is pending on the event, when it gets the event it executes some code and returns to pend waiting for the next event. 

 When the task is still executing the code, if another  GPIO interrupt is received, the task is preempted and the hardware ISR is executed and new event is posted.

What will happen to this new event as the task is still tom be completed and pend for the next event.

Will the event be queued?  if so, How many such events can be queued ?

if events aren't queued do we lose these events?

if answers to these are available in SYS/BIOS user's guide,  i would thankful if somebody could guide me where to find it.

TIA

Narendra

  • Hi Narendra,

    First of all Events are binary. If the Event_post occurs while the task is running, the event is queued. Since it is binary, any additional Event_post, with the same eventId, basically does nothing. Here is the flow of your examples (I'm assuming only one eventId is being used for simplicity).

    Task                    ISR             Status of Event
    Event_pend (blocks)                     not signalled
                            Event_post      signalled
    Event_pend returns                      not signalled
    executing task code                     not signalled
    .                                       not signalled  
                            Event_post      signalled
    .                                       signalled  
    .                                       signalled  
                            Event_post      signalled (binary...so no change...)
    .                                       signalled  
    Event_pend returns immed.               signalled before Event_pend call/not signalled when Event_pend returns
    executing task code                     not signalled 

    Todd