# how to use interrupt service routine without interrupt.h file in avr? [closed]

In avr microcontroller, when using interrupt service routine ,you write the function :

ISR(Int_Vect){

}


To use this function you must include < avr/interrupt.h>. so now , i don't want to use the interrupt.h file because i am trying to write my driver. how to use interrupt service routine without interrupt.h file?

## closed as unclear what you're asking by Scott Seidman, Daniel Grillo, Autistic, pipe, Bence KaulicsOct 11 '16 at 9:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Maybe I'm misinterpreting the word "driver," but why would writing your own driver cause you to not want to include the manufacturer provided interface to interrupts? – Cort Ammon Oct 6 '16 at 22:35
• Why don't you open the interrupt.h file and see what it's doing? – DoxyLover Oct 6 '16 at 22:35
• @CortAmmon yes i want to use my own functions – Ahmed Yasen Oct 6 '16 at 22:38
• @DoxyLover it is not understandable :) – Ahmed Yasen Oct 6 '16 at 22:39
• "I don't want to use the interrupt.h file because I am trying to write my own driver" is a non sequitur. Unclear why you're asking, or what. – user207421 Oct 7 '16 at 1:15

avr/interrupt.h is actually pretty simple as far as interrupt headers go. Looking through it, I don't see anything you wouldn't need to keep in order to make interrupts work. There's very little extraneous fluff. It'd be helpful to take the time to get to where interrupt.h is understandable before you try to write your own replacement for it. I'd say that if you look at the define macros that you need (i.e. don't look at ISR_ALIAS unless you need to alias ISRs). Of those portions you are looking at, I'd say 90-100% of it is essential to handling interrupts. The only thing that might be optional is that you can avoid using variadic macros and __VA_ARGS__ if you are willing to rewrite that code every time rather than using a macro.