ioLibrary for Cortex M series
Macros | Typedefs
Macro Util
Collaboration diagram for Macro Util:

Macros

#define MEM_FREE(mem_p)   do{ if(mem_p) { free(mem_p); mem_p = NULL; } }while(0)
 
#define BITSET(var_v, bit_v)   (var_v |= bit_v)
 
#define BITCLR(var_v, bit_v)   (var_v &= ~(bit_v))
 

Typedefs

typedef union long2char_t long2char
 
typedef union short2char_t short2char
 

Detailed Description

Simple Macro Utilities.

Macro Definition Documentation

#define MEM_FREE (   mem_p)    do{ if(mem_p) { free(mem_p); mem_p = NULL; } }while(0)

If pointer is not NULL, free it and set to NULL.

Definition at line 39 of file util.h.

#define BITSET (   var_v,
  bit_v 
)    (var_v |= bit_v)

Set bit in variable.

Definition at line 40 of file util.h.

Referenced by sockwatch_set().

#define BITCLR (   var_v,
  bit_v 
)    (var_v &= ~(bit_v))

Clear bit in variable.

Definition at line 41 of file util.h.

Referenced by sockwatch_clr().

Typedef Documentation

General purpose type change union (32bit <-> 8bit).

General purpose type change union (16bit <-> 8bit).