Keil Logo

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: Thursday, February 25, 2021


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.