NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
Atomic Services APIs

Macros

#define ATOMIC_INIT(i)   (i)
 Initialize an atomic variable.
 
#define ATOMIC_DEFINE(name, num_bits)    atomic_t name[1 + ((num_bits) - 1) / ATOMIC_BITS]
 Define an array of atomic variables.
 
#define ATOMIC_INIT(i)   (i)
 Initialize an atomic variable.
 
#define ATOMIC_DEFINE(name, num_bits)    atomic_t name[1 + ((num_bits) - 1) / ATOMIC_BITS]
 Define an array of atomic variables.
 

Detailed Description

Macro Definition Documentation

◆ ATOMIC_DEFINE [1/2]

#define ATOMIC_DEFINE (   name,
  num_bits 
)     atomic_t name[1 + ((num_bits) - 1) / ATOMIC_BITS]

Define an array of atomic variables.

This macro defines an array of atomic variables containing at least num_bits bits.

Note
If used from file scope, the bits of the array are initialized to zero; if used from within a function, the bits are left uninitialized.
Parameters
nameName of array of atomic variables.
num_bitsNumber of bits needed.

◆ ATOMIC_DEFINE [2/2]

#define ATOMIC_DEFINE (   name,
  num_bits 
)     atomic_t name[1 + ((num_bits) - 1) / ATOMIC_BITS]

Define an array of atomic variables.

This macro defines an array of atomic variables containing at least num_bits bits.

Note
If used from file scope, the bits of the array are initialized to zero; if used from within a function, the bits are left uninitialized.
Parameters
nameName of array of atomic variables.
num_bitsNumber of bits needed.

◆ ATOMIC_INIT [1/2]

#define ATOMIC_INIT (   i)    (i)

Initialize an atomic variable.

This macro can be used to initialize an atomic variable. For example,

atomic_t my_var = ATOMIC_INIT(75);
#define ATOMIC_INIT(i)
Initialize an atomic variable.
Definition atomic.h:247
Parameters
iValue to assign to atomic variable.

◆ ATOMIC_INIT [2/2]

#define ATOMIC_INIT (   i)    (i)

Initialize an atomic variable.

This macro can be used to initialize an atomic variable. For example,

atomic_t my_var = ATOMIC_INIT(75);
Parameters
iValue to assign to atomic variable.