ARM Technical Support Knowledge Articles

DISABLING INTERRUPTS IN A FUNCTION

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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

SEE ALSO

Article last edited on: 2005-07-15 13:22:09

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential