View topic - ISR triggering an event

ISR triggering an event

anything that doesn't fit to other groups.

ISR triggering an event

Postby yihjen » Fri Dec 12, 2003 5:56 am

Upon scheduling the ISR, i read somewhere that the codes residing within should be as little as possible and the recommendation was to create a event from the isr. How do i create such a event that could execute parallell within PhAB so that the widgets still updates?

thanks and regards.
yihjen
yihjen
New Member
 
Posts: 5
Joined: Thu Nov 27, 2003 6:54 am

Postby rgallen » Fri Dec 12, 2003 5:54 pm

PtAppCreatePulse() will create an event object that you can return from an interrupt handler, to cause your Photon application code to be scheduled. See PtAppAddInput() in the docs to see how to "attach" your Photon code to the Pulse created with PtAppCreatePulse().

You should only write an interrupt handler if you need to to clear the interrupt source for a level sensitive hardware interrupt, otherwise just use InterruptAttachEvent() to cause the OS to deliver the Pulse created with PtAppCreatePulse().

Summary:

1. use PtAppCreatePulse() to create an event object.
2. attach your Photon code to this event using PtAppAddInput()
3. deliver the event from the interrupt handler (by returning it) to cause the code supplied in (1) to be scheduled.

btw: I am not going to comment on the suitability of an architecture where a GUI app contains an interrupt handler, but others may....
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm


Return to General Programming

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest