Author Topic: not able to debug  (Read 23108 times)

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #15 on: January 10, 2010, 01:48:22 PM »
hi mark

can u tell me how task get call when interrupt or event occurred ?


Regards suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: not able to debug
« Reply #16 on: January 10, 2010, 02:51:14 PM »
Hi Suhas

A task is always scheduled when a message is posted to its input queue.

Therefore, by posting an interrupt event to the input queue of a task from an interrupt routine, the task will then be scheduled and can recognise the reason for it being scheduled.

Interrupt events [fnInterruptMessage()]are the most efficient messages since they contain the interrupt event type in the message header and so the woken task immediately knows the event number without needing to read further message content. Interrupt events can't carry extra data. If extra data is to be sent it can be performed by constructing a complete message and sending it with fnWrite( INTERNAL_ROUTE, ...  );

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #17 on: January 10, 2010, 03:08:30 PM »
Hi Mark

but how program come to know which task is allocated  for which interrupt ? somewhere i need to mention in code where should i do?

Regards
suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: not able to debug
« Reply #18 on: January 10, 2010, 03:30:03 PM »
Hi Suhas

To send an interrupt message the following can be used:


extern QUEUE_TRANSFER fnInterruptMessage(UTASK_TASK Task, unsigned char ucIntEvent);

Task is the name of the task that you would like to be receive teh interrupt event and thus be scheduled.

Eg. from previous posts:

static void int_portC_bit7(void)
{
    fnInterruptMessage(MY_TASK, PORT_INT_EVENT);
}

Here the PORT_INT_EVENT is the event that is sent.
MY_TASK is the name of the task that it is sent to. This assumes a task with this name.

Examples of existing tasks are
TASK_APPLICATION
TASK_NETWORK_INDICATOR
TASK_USB

etc.

Regards

Mark