EPPL example libraries  0.1 alpha
 All Files Functions Variables Groups Pages
<macros> Helpfull macros

Macros

#define NOP()   {asm volatile("nop"::);}
 Assemlby NOP instruction. More...
 
#define ELEMS(p)   (sizeof(p)/sizeof(p[0]))
 Number of elements. More...
 
#define NOINIT   __attribute__ ((section (".noinit")))
 Create non initialized variable. More...
 
#define CONNECT_NAMES(a, b)   XCONNECT_NAMES(a, b)
 Concat two mnemonics. More...
 
#define MAKE_TEXT(x)   XMAKE_TEXT(x)
 Change mnemonic to string. More...
 
#define MIN(a, b)   ( (a) < (b) ? (a) : (b) )
 Minimum value. More...
 
#define MAX(a, b)   ( (a) > (b) ? (a) : (b) )
 Maximum value. More...
 

Detailed Description

Group of helpfull macros for common usage

Macro Definition Documentation

#define CONNECT_NAMES (   a,
 
)    XCONNECT_NAMES(a, b)

Concat two mnemonics.

Macro that concats two mnemonics

#define ELEMS (   p)    (sizeof(p)/sizeof(p[0]))

Number of elements.

Macro that counts number of elements inside the table

Examples:
base/main.c.
#define MAKE_TEXT (   x)    XMAKE_TEXT(x)

Change mnemonic to string.

Macro changes given argument to text in quotes

#define MAX (   a,
 
)    ( (a) > (b) ? (a) : (b) )

Maximum value.

Macro that takes maximum value of two

See Also
MIN
#define MIN (   a,
 
)    ( (a) < (b) ? (a) : (b) )

Minimum value.

Macro that takes minimum value of two

Attention
Do not modify a or b value in macro call. It may give unexpeced result
#define NOINIT   __attribute__ ((section (".noinit")))

Create non initialized variable.

Syntax sugar for putting variable into .noinit section

#define NOP ( )    {asm volatile("nop"::);}

Assemlby NOP instruction.

Empty instruction, that may be used for delays or synchronization