Keil Logo

GENERAL: STATIC INTERRUPT FUNCTIONS


Information in this article applies to:

  • C166 All Versions
  • C251 All Versions
  • C51 All Versions

QUESTION

I've noticed that in many places interrupt routines defined in C are declared with the static keyword. For example:

static void ISR (void) interrupt 0
{
}

Why is that?

ANSWER

It's just good practice to declare the ISR static. The static keyword makes the interrupt function invisible to functions outside the file where it is defined. This makes sense because the interrupt function can't actually be called by another function.

Last Reviewed: Friday, December 17, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.