global.h
Go to the documentation of this file.
00001 #ifndef __GLOBAL_H__
00002 #define __GLOBAL_H__
00003 
00004 
00005 #ifdef __WIN32__
00006   #define COM1 "Port=1"
00007   #define COM2 "Port=2"
00008   #define COM3 "Port=3"
00009   #define COM4 "Port=4"
00010 #else
00011   #define COM1 "ComDeviceName=/dev/ttyS0"
00012   #define COM2 "ComDeviceName=/dev/ttyS1"
00013   #define COM3 "ComDeviceName=/dev/ttyS2"
00014   #define COM4 "ComDeviceName=/dev/ttyS3"
00015 #endif
00016 
00017 #define USB     0
00018 #define SERIELL 1
00019 
00020 
00021 
00022 #ifdef __WIN32__
00023   // **** Windows
00024   #if COM_MODE == USB
00025     #ifdef HW_SNR
00026       #define DEVICE_OPEN "Snr="HW_SNR
00027     #endif
00028   #else
00029     #define DEVICE_OPEN COM_PORT";BaudRate="BAUD_RATE
00030   #endif
00031   #define TREIBER_NAME NULL   
00032   #include "windows.h"
00033   #define CALLBACK_TYPE CALLBACK
00034 
00035   #define UtilInit()
00036   #define KeyHit kbhit
00037 #else
00038   // **** Linux
00039   #if COM_MODE == USB
00040     #ifdef HW_SNR
00041       #define DEVICE_OPEN "Snr="HW_SNR
00042     #endif
00043   #else
00044     #define DEVICE_OPEN COM_PORT";BaudRate="BAUD_RATE
00045   #endif
00046   #ifdef __APPLE__
00047     #define TREIBER_NAME "./../../../can_api/libmhstcan.dylib"
00048   #else
00049     //#define TREIBER_NAME "./../../../can_api/libmhstcan.so"
00050     #define TREIBER_NAME "/home/vmuser/catkin_ws/src/can/lib/libmhstcan.so"  
00051   #endif  
00052   #include <unistd.h>
00053   #include "linux_util.h"
00054 
00055   #define Sleep(x) usleep((x) * 1000)
00056   #define CALLBACK_TYPE
00057 
00058 #endif
00059 
00060 #ifndef TREIBER_INIT
00061 #define TREIBER_INIT NULL
00062 #endif
00063 
00064 #ifndef DEVICE_OPEN
00065 #define DEVICE_OPEN NULL
00066 #endif
00067 
00068 
00069 #endif


tinycan
Author(s): M.Fischer
autogenerated on Thu Jun 6 2019 20:39:28