1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/inc/utils.h
Bogdan Marinescu b6e7ade77c - malloc.c/.h are now dlmalloc.c/.h
- new shell command: mem
- new module: bit (for bit operations)
- removed UARTx, TMRx, SPIx, PWMx constants from the respectives modules, as they only waste memory space. But now the same
  modules will return an error (via luaL_error) if an invalid resource ID is used. Note that this does not apply to PIO, since
  PIO uses special encodings for ports/pins.
- new methods in pio: port and pin to return the port/pin encoded in a pio value.
2008-08-27 13:39:10 +00:00

11 lines
285 B
C

// General purpose function/macros
#ifndef __UTILS_H__
#define __UTILS_H__
#define ABSDIFF( x, y ) ( ( x ) >= ( y ) ? ( x ) - ( y ) : ( y ) - ( x ) )
#define UMIN( x, y ) ( ( x ) <= ( y ) ? ( x ) : ( y ) )
#define UABS( x ) ( ( x ) >= 0 ? ( x ) : -( x ) )
#endif