Keil™, An ARM® Company

Technical Support

C166: DISABLING INTERRUPTS IN A FUNCTION


Information in this article applies to:

  • C166 All Versions

QUESTION

How do I disable interrupts in a function?

ANSWER

Use #pragma disable to disable interrupts for the duration of a function. For example:

#pragma disable
void function (void)
{
if (flag == 0)
  {
  flag = 1;
  flag2 = 1;
  }
}

This disables interrupts on entry to function and restores interrupts when exiting.

MORE INFORMATION

  • Refer to DISABLE in the C166 User's Guide.

SEE ALSO

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure