]> git.zerfleddert.de Git - proxmark3-svn/blame - include/common.h
CHG: `lf em` - refactored @marshmellow42 's em paritycheck.
[proxmark3-svn] / include / common.h
CommitLineData
534983d7 1//-----------------------------------------------------------------------------
2// Hagen Fritsch - June 2010
3//
4// This code is licensed to you under the terms of the GNU GPL, version 2 or,
5// at your option, any later version. See the LICENSE.txt file for the text of
6// the license.
7
8//-----------------------------------------------------------------------------
9// Interlib Definitions
10//-----------------------------------------------------------------------------
11
12#ifndef __COMMON_H
13#define __COMMON_H
14
902cb3c0 15#include <stddef.h>
873014de 16#include <stdint.h>
902cb3c0 17#include <stdbool.h>
18#include <at91sam7s512.h>
d19929cb 19typedef unsigned char byte_t;
873014de 20
53d5dc64 21// debug
22// 0 - no debug messages 1 - error messages 2 - all messages 4 - extended debug mode
23#define MF_DBG_NONE 0
24#define MF_DBG_ERROR 1
25#define MF_DBG_ALL 2
26#define MF_DBG_EXTENDED 4
27extern int MF_DBGLEVEL;
28
29// reader voltage field detector
30#define MF_MINFIELDV 4000
31
32
759c16b3 33#ifndef MIN
34# define MIN(a, b) (((a) < (b)) ? (a) : (b))
35#endif
f2c2b174 36
759c16b3 37#ifndef MAX
38# define MAX(a, b) (((a) > (b)) ? (a) : (b))
39#endif
28fdb04f 40
f2c2b174 41#ifndef ABS
42# define ABS(a) ( ((a)<0) ? -(a) : (a) )
43#endif
ce55f5a2 44#define RAMFUNC __attribute((long_call, section(".ramfunc")))
534983d7 45#endif
Impressum, Datenschutz