#include <intrins.h>
void _atomic_ (
unsigned int n); /* number of instructions to protect */
Description
The _atomic_ routine allows you to protect a number of
instructions from hardware interrupts. When you use this function,
the C166 Compiler inserts an ATOMIC instruction into your program.
The argument n specifies the number of
instructions to protect (1-4).
If a value of 0 is used for n, the
_endatomic_ function must be used to terminate the atomic
sequence. The compiler automatically calculates the number of
instructions protected from interrupts.
Note
Typically, you should use _atomic_(0) to begin an atomic
sequence and _endatomic_() to terminate the sequence. This
process automatically generates the correct atomic length.
The _atomic_ and _endatomic_ routines may be used
only when the MOD167 control
is specified because the ATOMIC instruction is available only in
the C167 instruction set.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.