diff -r f45fd4cd3832 -r 34654679f262 doc/doxygen/html/can__peak__win32_8c-source.html --- a/doc/doxygen/html/can__peak__win32_8c-source.html Fri Jul 06 10:53:15 2007 +0200 +++ b/doc/doxygen/html/can__peak__win32_8c-source.html Mon Jul 16 08:56:03 2007 +0200 @@ -18,7 +18,7 @@
00001 /* 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 00003 @@ -54,7 +54,7 @@ 00033 #include "can_driver.h" 00034 00035 #ifndef extra_PCAN_init_params -00036 #define extra_PCAN_init_params +00036 #define extra_PCAN_init_params 00037 #else 00038 #define extra_PCAN_init_params\ 00039 ,getenv("PCANHwType") ? strtol(getenv("PCANHwType"),NULL,0):0\ @@ -70,10 +70,10 @@ 00049 //pthread_mutex_t PeakCan_mutex = PTHREAD_MUTEX_INITIALIZER; 00050 00051 // Define for rtr CAN message -00052 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR +00052 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR 00053 00054 /***************************************************************************/ -00055 int TranslateBaudeRate(char* optarg){ +00055 int TranslateBaudeRate(char* optarg){ 00056 if(!strcmp( optarg, "1M")) return CAN_BAUD_1M; 00057 if(!strcmp( optarg, "500K")) return CAN_BAUD_500K; 00058 if(!strcmp( optarg, "250K")) return CAN_BAUD_250K; @@ -88,28 +88,28 @@ 00067 } 00068 00069 void -00070 canInit (s_BOARD *board) +00070 canInit (s_BOARD *board) 00071 { 00072 int baudrate; 00073 00074 #ifdef PCAN2_HEADER_ 00075 // if not the first handler 00076 if(second_board == (s_BOARD *)board) -00077 if(baudrate = TranslateBaudeRate(board->baudrate)) +00077 if(baudrate = TranslateBaudeRate(board->baudrate)) 00078 CAN2_Init (baudrate, -00079 CAN_INIT_TYPE_ST extra_PCAN_init_params); +00079 CAN_INIT_TYPE_ST extra_PCAN_init_params); 00080 #endif 00081 if(first_board == (s_BOARD *)board) -00082 if(baudrate = TranslateBaudeRate(board->baudrate)) +00082 if(baudrate = TranslateBaudeRate(board->baudrate)) 00083 CAN_Init (baudrate, 00084 CAN_INIT_TYPE_ST extra_PCAN_init_params); 00085 } 00086 00087 /*********functions which permit to communicate with the board****************/ -00088 UNS8 -00089 canReceive_driver (CAN_HANDLE fd0, Message * m) +00088 UNS8 +00089 canReceive_driver (CAN_HANDLE fd0, Message * m) 00090 { -00091 UNS8 data; +00091 UNS8 data; 00092 TPCANMsg peakMsg; 00093 00094 DWORD Res; @@ -140,7 +140,7 @@ 00119 if (peakMsg.MSGTYPE == CAN_ERR_BUSOFF) 00120 { 00121 printf ("!!! Peak board read : re-init\n"); -00122 canInit((s_BOARD*) fd0); +00122 canInit((s_BOARD*) fd0); 00123 usleep (10000); 00124 } 00125 @@ -149,14 +149,14 @@ 00128 return peakMsg.MSGTYPE == 00129 MSGTYPE_STATUS ? peakMsg.DATA[2] : CAN_ERR_OVERRUN; 00130 } -00131 m->cob_id.w = peakMsg.ID; +00131 m->cob_id.w = peakMsg.ID; 00132 if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_ */ -00133 m->rtr = 0; +00133 m->rtr = 0; 00134 else -00135 m->rtr = 1; -00136 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ +00135 m->rtr = 1; +00136 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ 00137 for (data = 0; data < peakMsg.LEN; data++) -00138 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ +00138 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ 00139 00140 }else{ 00141 //pthread_mutex_unlock (&PeakCan_mutex); @@ -176,22 +176,22 @@ 00155 } 00156 00157 /***************************************************************************/ -00158 UNS8 -00159 canSend_driver (CAN_HANDLE fd0, Message * m) +00158 UNS8 +00159 canSend_driver (CAN_HANDLE fd0, Message * m) 00160 { -00161 UNS8 data; +00161 UNS8 data; 00162 TPCANMsg peakMsg; -00163 peakMsg.ID = m->cob_id.w; /* 11/29 bit code */ -00164 if (m->rtr == 0) +00163 peakMsg.ID = m->cob_id.w; /* 11/29 bit code */ +00164 if (m->rtr == 0) 00165 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_ */ 00166 else 00167 { -00168 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_ */ +00168 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_ */ 00169 } -00170 peakMsg.LEN = m->len; +00170 peakMsg.LEN = m->len; 00171 /* count of data bytes (0..8) */ -00172 for (data = 0; data < m->len; data++) -00173 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ +00172 for (data = 0; data < m->len; data++) +00173 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ 00174 do 00175 { 00176 #ifdef PCAN2_HEADER_ @@ -209,7 +209,7 @@ 00188 if (errno == CAN_ERR_BUSOFF) 00189 { 00190 printf ("!!! Peak board write : re-init\n"); -00191 canInit((s_BOARD*)fd0); +00191 canInit((s_BOARD*)fd0); 00192 usleep (10000); 00193 } 00194 usleep (1000); @@ -222,8 +222,8 @@ 00201 } 00202 00203 /***************************************************************************/ -00204 CAN_HANDLE -00205 canOpen_driver (s_BOARD * board) +00204 CAN_HANDLE +00205 canOpen_driver (s_BOARD * board) 00206 { 00207 #ifdef PCAN2_HEADER_ 00208 if(first_board != NULL && second_board != NULL) @@ -248,14 +248,14 @@ 00227 first_board = board; 00228 #endif 00229 -00230 canInit(board); +00230 canInit(board); 00231 -00232 return (CAN_HANDLE)board; +00232 return (CAN_HANDLE)board; 00233 } 00234 00235 /***************************************************************************/ 00236 int -00237 canClose_driver (CAN_HANDLE fd0) +00237 canClose_driver (CAN_HANDLE fd0) 00238 { 00239 #ifdef PCAN2_HEADER_ 00240 // if not the first handler @@ -272,7 +272,7 @@ 00251 } 00252 return 0; 00253 } -