]>
Commit | Line | Data |
---|---|---|
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 | ||
15 | #ifdef __cplusplus | |
16 | extern "C" { | |
17 | #endif | |
18 | ||
19 | #include <stddef.h> | |
20 | #include <stdint.h> | |
21 | #include <stdbool.h> | |
22 | #include <at91sam7s512.h> | |
23 | typedef unsigned char byte_t; | |
24 | ||
25 | // debug | |
26 | // 0 - no debug messages 1 - error messages 2 - all messages 4 - extended debug mode | |
27 | #define MF_DBG_NONE 0 | |
28 | #define MF_DBG_ERROR 1 | |
29 | #define MF_DBG_ALL 2 | |
30 | #define MF_DBG_EXTENDED 4 | |
31 | extern int MF_DBGLEVEL; | |
32 | ||
33 | // reader voltage field detector | |
34 | #define MF_MINFIELDV 4000 | |
35 | ||
36 | #ifndef MIN | |
37 | # define MIN(a, b) (((a) < (b)) ? (a) : (b)) | |
38 | #endif | |
39 | ||
40 | #ifndef MAX | |
41 | # define MAX(a, b) (((a) > (b)) ? (a) : (b)) | |
42 | #endif | |
43 | ||
44 | #ifndef ABS | |
45 | # define ABS(a) ( ((a)<0) ? -(a) : (a) ) | |
46 | #endif | |
47 | #define RAMFUNC __attribute((long_call, section(".ramfunc"))) | |
48 | ||
49 | ||
50 | #ifdef __cplusplus | |
51 | } | |
52 | #endif | |
53 | ||
54 | #endif |