Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Interrupt question (http://www.chiefdelphi.com/forums/showthread.php?t=35879)

Kashi Chan 06-03-2005 22:19

Interrupt question
 
searched saw the white papers on interrupts for dummies, yet i still dont quite understand how to implement them. so far i have downloaded the kevin frc code for interrupts and transfered my code into the program. our banner sensors are hooked up to rc_dig_in01 02 and 03. is that all i need to do or am i missing something?

Ryan M. 07-03-2005 07:03

Re: Interrupt question
 
Disclaimer: I've never actually gotten them working, so you might not want to trust me... ;)

Two things which you have to do with Kevin's code to make it actually do something:
  • Put some implementation in the interrupt handler (in user_routines_fast.c). Actually, Kevin has been extremely helpful by having a function call for each interrupt in there already. Just go into interrupts.c and find the appropriate handler for the one you want. (Read the comments if it is unclear. He does and excellent job with those. :D)
  • Turn them on! This is actually two things, (1) make sure you call the interrupt initializers you want in user_initialization (in user_routines.c) and (2) actually enable the interrupt in the initializing function. Read the comments at the bottom of the initializing routine to see how.

Mike Betts 07-03-2005 08:28

Re: Interrupt question
 
Quote:

Originally Posted by Kashi Chan
searched saw the white papers on interrupts for dummies, yet i still dont quite understand how to implement them. so far i have downloaded the kevin frc code for interrupts and transfered my code into the program. our banner sensors are hooked up to rc_dig_in01 02 and 03. is that all i need to do or am i missing something?

Kashi,

Have you tried reading this? It gives side by side examples on how to implement something (in this case, a timer) both with and without interrupts.

Please give it a try and repost here if you are still confused.

Mike


All times are GMT -5. The time now is 04:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi