21 */ |
21 */ |
22 |
22 |
23 #ifndef __APPLICFG_LINUX__ |
23 #ifndef __APPLICFG_LINUX__ |
24 #define __APPLICFG_LINUX__ |
24 #define __APPLICFG_LINUX__ |
25 |
25 |
|
26 #ifndef __KERNEL__ |
26 #include <string.h> |
27 #include <string.h> |
27 #include <stdio.h> |
28 #include <stdio.h> |
28 #include <sys/types.h> |
29 #include <sys/types.h> |
|
30 #else |
|
31 #include <linux/types.h> |
|
32 #endif |
29 |
33 |
30 /* Define the architecture : little_endian or big_endian |
34 /* Define the architecture : little_endian or big_endian |
31 ----------------------------------------------------- |
35 ----------------------------------------------------- |
32 Test : |
36 Test : |
33 UNS32 v = 0x1234ABCD; |
37 UNS32 v = 0x1234ABCD; |
70 #define REAL32 float |
74 #define REAL32 float |
71 #define REAL64 double |
75 #define REAL64 double |
72 |
76 |
73 /* Definition of error and warning macros */ |
77 /* Definition of error and warning macros */ |
74 /* -------------------------------------- */ |
78 /* -------------------------------------- */ |
75 #if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON |
79 #ifndef __KERNEL__ |
76 #include <stdio.h> |
80 # include <stdio.h> |
|
81 # define MSG(...) printf (__VA_ARGS__) |
|
82 #else |
|
83 # define MSG(...) printk (__VA_ARGS__) |
77 #endif |
84 #endif |
78 |
85 |
79 /* Definition of MSG_ERR */ |
86 /* Definition of MSG_ERR */ |
80 /* --------------------- */ |
87 /* --------------------- */ |
81 #ifdef DEBUG_ERR_CONSOLE_ON |
88 #ifdef DEBUG_ERR_CONSOLE_ON |
82 # define MSG_ERR(num, str, val) \ |
89 # define MSG_ERR(num, str, val) \ |
83 printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); |
90 MSG("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); |
84 #else |
91 #else |
85 # define MSG_ERR(num, str, val) |
92 # define MSG_ERR(num, str, val) |
86 #endif |
93 #endif |
87 |
94 |
88 /* Definition of MSG_WAR */ |
95 /* Definition of MSG_WAR */ |
89 /* --------------------- */ |
96 /* --------------------- */ |
90 #ifdef DEBUG_WAR_CONSOLE_ON |
97 #ifdef DEBUG_WAR_CONSOLE_ON |
91 # define MSG_WAR(num, str, val) \ |
98 # define MSG_WAR(num, str, val) \ |
92 printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); |
99 MSG("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); |
93 #else |
100 #else |
94 # define MSG_WAR(num, str, val) |
101 # define MSG_WAR(num, str, val) |
95 #endif |
102 #endif |
96 |
103 |
97 typedef void* CAN_HANDLE; |
104 typedef void* CAN_HANDLE; |