cygwin/pcan_light commit. Changes in configure for dual port handling.
--- a/configure Tue Aug 08 22:34:32 2006 +0200
+++ b/configure Thu Aug 10 08:53:05 2006 +0200
@@ -456,8 +456,13 @@
echo >> include/can_peak_win32/cancfg.h
grep __stdcall $PCAN_INCLUDE/$PCAN2_HEADER >> include/can_peak_win32/cancfg.h
SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ \'$PCAN2_LIB\'
- fi
- echo '#define PCAN2_HEADER_' >> include/can_peak_win32/cancfg.h
+ echo '#define PCAN2_HEADER_' >> include/can_peak_win32/cancfg.h
+ fi
+ if grep -q CANHwType include/can_peak_win32/cancfg.h ; then
+ echo "Peak Init HwType, IO_Port and IRQ will be passed in environment :"
+ echo " PCANHwType PCANIO_Port PCANInterupt"
+ echo '#define extra_PCAN_init_params' >> include/can_peak_win32/cancfg.h
+ fi
cat include/can_peak_win32/cancfg.h.tail >> include/can_peak_win32/cancfg.h
fi
--- a/drivers/can_peak_win32/can_peak_win32.c Tue Aug 08 22:34:32 2006 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.c Thu Aug 10 08:53:05 2006 +0200
@@ -22,7 +22,7 @@
//****************************************************************************
/*
- Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Tue Aug 8 23:36:30 2006
+ Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Wed Aug 9 08:28:43 2006
*/
#include<stdio.h>
#include<string.h>
@@ -42,73 +42,78 @@
#include"cobf.h"
#ifndef extra_PCAN_init_params
#define extra_PCAN_init_params
+#else
+#define extra_PCAN_init_params , pcan_o("PCANHwType") ? pcan_6( \
+pcan_o("PCANHwType"), pcan_v,0):0 , pcan_o("PCANIO_Port") ? pcan_6( \
+pcan_o("PCANIO_Port"), pcan_v,0):0 , pcan_o("PCANInterupt") ? pcan_6( \
+ pcan_o("PCANInterupt"), pcan_v,0):0
#endif
#ifdef PCAN2_HEADER_
-#define pcan_s 2
+#define pcan_t 2
#else
-#define pcan_s 1
+#define pcan_t 1
#endif
-pcan_34 pcan_51{pcan_9 pcan_r;pcan_39 pcan_1;pcan_24*pcan_o;pcan_16*
-pcan_k;}pcan_c;pcan_c pcan_g[pcan_s]={{0,},};pcan_47 pcan_l=pcan_38;
-pcan_12 pcan_x(pcan_n pcan_b){
+pcan_37 pcan_53{pcan_11 pcan_r;pcan_41 pcan_5;pcan_26*pcan_s;pcan_27*
+pcan_l;}pcan_c;pcan_c pcan_h[pcan_t]={{0,},};pcan_48 pcan_k=pcan_40;
+pcan_14 pcan_0(pcan_m pcan_b){
#ifdef PCAN2_HEADER_
-pcan_d(pcan_g!=((pcan_c* )pcan_b))pcan_52(((pcan_c* )pcan_b)->pcan_k
-->pcan_20,pcan_v extra_PCAN_init_params);pcan_j
+pcan_d(pcan_h!=((pcan_c* )pcan_b))pcan_55(((pcan_c* )pcan_b)->pcan_l
+->pcan_20,pcan_y extra_PCAN_init_params);pcan_j
#endif
-pcan_54(((pcan_c* )pcan_b)->pcan_k->pcan_20,pcan_v
-extra_PCAN_init_params);}pcan_t pcan_17(pcan_n pcan_b,pcan_4*pcan_e){
-pcan_t pcan_f;pcan_23 pcan_a;pcan_11 pcan_i;pcan_22(&pcan_l);
+pcan_57(((pcan_c* )pcan_b)->pcan_l->pcan_20,pcan_y
+extra_PCAN_init_params);}pcan_u pcan_17(pcan_m pcan_b,pcan_8*pcan_e){
+pcan_u pcan_f;pcan_24 pcan_a;pcan_13 pcan_i;pcan_19(&pcan_k);
#ifdef PCAN2_HEADER_
-pcan_d(pcan_g!=((pcan_c* )pcan_b))pcan_i=pcan_27(&pcan_a);pcan_j
+pcan_d(pcan_h!=((pcan_c* )pcan_b))pcan_i=pcan_31(&pcan_a);pcan_j
#endif
-pcan_i=pcan_48(&pcan_a);pcan_d(pcan_i==pcan_w){pcan_d(pcan_a.pcan_q&~
-(pcan_14|pcan_10)){pcan_d(pcan_a.pcan_q==pcan_25){pcan_7("\x21\x21"
+pcan_i=pcan_51(&pcan_a);pcan_d(pcan_i==pcan_w){pcan_d(pcan_a.pcan_n&~
+(pcan_28|pcan_15)){pcan_d(pcan_a.pcan_n==pcan_23){pcan_2("\x21\x21"
"\x21\x20\x50\x65\x61\x6b\x20\x62\x6f\x61\x72\x64\x20\x72\x65\x61\x64"
-"\x20\x3a\x20\x72\x65\x2d\x69\x6e\x69\x74\n");pcan_x(pcan_b);pcan_y(
-10000);}pcan_u(&pcan_l);pcan_p pcan_a.pcan_q==pcan_28?pcan_a.pcan_8[2
-]:pcan_46;}pcan_e->pcan_13.pcan_15=pcan_a.pcan_18;pcan_d(pcan_a.
-pcan_q==pcan_v)pcan_e->pcan_2=0;pcan_j pcan_e->pcan_2=1;pcan_e->
-pcan_z=pcan_a.pcan_6;pcan_3(pcan_f=0;pcan_f<pcan_a.pcan_6;pcan_f++)pcan_e
-->pcan_f[pcan_f]=pcan_a.pcan_8[pcan_f];}pcan_u(&pcan_l);pcan_p pcan_i
-;}pcan_12 pcan_44(pcan_n pcan_b){pcan_24*pcan_o=((pcan_c* )pcan_b)->
-pcan_o;pcan_4 pcan_e;pcan_19(((pcan_c* )pcan_b)->pcan_r){pcan_11
-pcan_i;pcan_d((pcan_i=pcan_17(pcan_b,&pcan_e))==pcan_w){pcan_26();
-pcan_50(pcan_o,&pcan_e);pcan_30();}pcan_j{pcan_d(!(pcan_i&pcan_31||
-pcan_i&pcan_40||pcan_i&pcan_45)){pcan_7("\x63\x61\x6e\x52\x65\x63\x65"
+"\x20\x3a\x20\x72\x65\x2d\x69\x6e\x69\x74\n");pcan_0(pcan_b);pcan_x(
+10000);}pcan_z(&pcan_k);pcan_q pcan_a.pcan_n==pcan_32?pcan_a.pcan_12[
+2]:pcan_50;}pcan_e->pcan_16.pcan_25=pcan_a.pcan_18;pcan_d(pcan_a.
+pcan_n==pcan_y)pcan_e->pcan_9=0;pcan_j pcan_e->pcan_9=1;pcan_e->
+pcan_1=pcan_a.pcan_7;pcan_3(pcan_f=0;pcan_f<pcan_a.pcan_7;pcan_f++)pcan_e
+->pcan_f[pcan_f]=pcan_a.pcan_12[pcan_f];}pcan_z(&pcan_k);pcan_q pcan_i
+;}pcan_14 pcan_47(pcan_m pcan_b){pcan_26*pcan_s=((pcan_c* )pcan_b)->
+pcan_s;pcan_8 pcan_e;pcan_21(((pcan_c* )pcan_b)->pcan_r){pcan_13
+pcan_i;pcan_d((pcan_i=pcan_17(pcan_b,&pcan_e))==pcan_w){pcan_30();
+pcan_54(pcan_s,&pcan_e);pcan_35();}pcan_j{pcan_d(!(pcan_i&pcan_33||
+pcan_i&pcan_42||pcan_i&pcan_49)){pcan_2("\x63\x61\x6e\x52\x65\x63\x65"
"\x69\x76\x65\x20\x72\x65\x74\x75\x72\x6e\x65\x64\x20\x65\x72\x72\x6f"
-"\x72\x20\x28\x25\x64\x29\n",pcan_i);}pcan_y(1000);}}}pcan_t pcan_41(
-pcan_n pcan_b,pcan_4*pcan_e){pcan_t pcan_f;pcan_23 pcan_a;pcan_a.
-pcan_18=pcan_e->pcan_13.pcan_15;pcan_d(pcan_e->pcan_2==0)pcan_a.
-pcan_q=pcan_v;pcan_j{pcan_a.pcan_q=pcan_14|pcan_10;}pcan_a.pcan_6=
-pcan_e->pcan_z;pcan_3(pcan_f=0;pcan_f<pcan_e->pcan_z;pcan_f++)pcan_a.
-pcan_8[pcan_f]=pcan_e->pcan_f[pcan_f];pcan_m=pcan_w;pcan_32{pcan_22(&
-pcan_l);
+"\x72\x20\x28\x25\x64\x29\n",pcan_i);}pcan_x(1000);}}}pcan_u pcan_43(
+pcan_m pcan_b,pcan_8*pcan_e){pcan_u pcan_f;pcan_24 pcan_a;pcan_a.
+pcan_18=pcan_e->pcan_16.pcan_25;pcan_d(pcan_e->pcan_9==0)pcan_a.
+pcan_n=pcan_y;pcan_j{pcan_a.pcan_n=pcan_28|pcan_15;}pcan_a.pcan_7=
+pcan_e->pcan_1;pcan_3(pcan_f=0;pcan_f<pcan_e->pcan_1;pcan_f++)pcan_a.
+pcan_12[pcan_f]=pcan_e->pcan_f[pcan_f];pcan_p=pcan_w;pcan_36{pcan_19(
+&pcan_k);
#ifdef PCAN2_HEADER_
-pcan_d(pcan_g!=((pcan_c* )pcan_b))pcan_m=pcan_53(&pcan_a);pcan_j
+pcan_d(pcan_h!=((pcan_c* )pcan_b))pcan_p=pcan_56(&pcan_a);pcan_j
#endif
-pcan_m=pcan_43(&pcan_a);pcan_d(pcan_m){pcan_d(pcan_m==pcan_25){pcan_7
+pcan_p=pcan_46(&pcan_a);pcan_d(pcan_p){pcan_d(pcan_p==pcan_23){pcan_2
("\x21\x21\x21\x20\x50\x65\x61\x6b\x20\x62\x6f\x61\x72\x64\x20\x77"
-"\x72\x69\x74\x65\x20\x3a\x20\x72\x65\x2d\x69\x6e\x69\x74\n");pcan_x(
-pcan_b);pcan_y(10000);}pcan_u(&pcan_l);pcan_y(100);}pcan_j{pcan_u(&
-pcan_l);}}pcan_19(pcan_m!=pcan_w&&((pcan_c* )pcan_b)->pcan_r);pcan_p 0
-;}pcan_n pcan_42(pcan_16*pcan_k){pcan_9 pcan_55[64];pcan_9*pcan_36;
-pcan_21 pcan_h;pcan_3(pcan_h=0;pcan_h<pcan_s;pcan_h++){pcan_d(!pcan_g
-[pcan_h].pcan_r)pcan_56;}pcan_d(pcan_h==pcan_s){pcan_0(pcan_5,"\x4f"
-"\x70\x65\x6e\x20\x66\x61\x69\x6c\x65\x64\x2e\n");pcan_0(pcan_5,"\x63"
-"\x61\x6e\x5f\x70\x65\x61\x6b\x5f\x77\x69\x6e\x33\x32\x2e\x63\x3a\x20"
-"\x6e\x6f\x20\x6d\x6f\x72\x65\x20\x63\x61\x6e\x20\x70\x6f\x72\x74\x20"
-"\x61\x76\x61\x69\x6c\x61\x62\x6c\x65\x20\x77\x69\x74\x68\x20\x74\x68"
-"\x69\x73\x20\x70\x63\x61\x6e\x20\x6c\x69\x62\x72\x61\x72\x79\n");
-pcan_0(pcan_5,"\x63\x61\x6e\x5f\x70\x65\x61\x6b\x5f\x77\x69\x6e\x33"
+"\x72\x69\x74\x65\x20\x3a\x20\x72\x65\x2d\x69\x6e\x69\x74\n");pcan_0(
+pcan_b);pcan_x(10000);}pcan_z(&pcan_k);pcan_x(100);}pcan_j{pcan_z(&
+pcan_k);}}pcan_21(pcan_p!=pcan_w&&((pcan_c* )pcan_b)->pcan_r);pcan_q 0
+;}pcan_m pcan_44(pcan_27*pcan_l){pcan_11 pcan_58[64];pcan_11*pcan_39;
+pcan_22 pcan_g;pcan_3(pcan_g=0;pcan_g<pcan_t;pcan_g++){pcan_d(!pcan_h
+[pcan_g].pcan_r)pcan_45;}pcan_d(pcan_g==pcan_t){pcan_4(pcan_10,"\x4f"
+"\x70\x65\x6e\x20\x66\x61\x69\x6c\x65\x64\x2e\n");pcan_4(pcan_10,""
+"\x63\x61\x6e\x5f\x70\x65\x61\x6b\x5f\x77\x69\x6e\x33\x32\x2e\x63\x3a"
+"\x20\x6e\x6f\x20\x6d\x6f\x72\x65\x20\x63\x61\x6e\x20\x70\x6f\x72\x74"
+"\x20\x61\x76\x61\x69\x6c\x61\x62\x6c\x65\x20\x77\x69\x74\x68\x20\x74"
+"\x68\x69\x73\x20\x70\x63\x61\x6e\x20\x6c\x69\x62\x72\x61\x72\x79\n");
+pcan_4(pcan_10,"\x63\x61\x6e\x5f\x70\x65\x61\x6b\x5f\x77\x69\x6e\x33"
"\x32\x2e\x63\x3a\x20\x70\x6c\x65\x61\x73\x65\x20\x6c\x69\x6e\x6b\x20"
"\x61\x6e\x6f\x74\x68\x65\x72\x20\x65\x78\x65\x63\x75\x74\x61\x62\x6c"
"\x65\x20\x77\x69\x74\x68\x20\x61\x6e\x6f\x74\x68\x65\x72\x20\x70\x63"
-"\x61\x6e\x20\x6c\x69\x62\n");pcan_p pcan_37;}pcan_g[pcan_h].pcan_r=1
-;pcan_g[pcan_h].pcan_k=pcan_k;pcan_g[pcan_h].pcan_o=pcan_k->pcan_o;
-pcan_x((pcan_c* )&pcan_g[pcan_h]);pcan_29((pcan_c* )&pcan_g[pcan_h],&
-pcan_g[pcan_h].pcan_1);pcan_p(pcan_c* )&pcan_g[pcan_h];}pcan_21
-pcan_57(pcan_n pcan_b){((pcan_c* )pcan_b)->pcan_r=0;
+"\x61\x6e\x20\x6c\x69\x62\n");pcan_q pcan_v;}pcan_h[pcan_g].pcan_r=1;
+pcan_h[pcan_g].pcan_l=pcan_l;pcan_h[pcan_g].pcan_s=pcan_l->pcan_s;
+pcan_0((pcan_c* )&pcan_h[pcan_g]);pcan_34((pcan_c* )&pcan_h[pcan_g],&
+pcan_h[pcan_g].pcan_5);pcan_q(pcan_c* )&pcan_h[pcan_g];}pcan_22
+pcan_59(pcan_m pcan_b){((pcan_c* )pcan_b)->pcan_r=0;
#ifdef PCAN2_HEADER_
-pcan_d(pcan_g!=((pcan_c* )pcan_b))pcan_49();pcan_j
+pcan_d(pcan_h!=((pcan_c* )pcan_b))pcan_52();pcan_j
#endif
-pcan_35();pcan_33(&((pcan_c* )pcan_b)->pcan_1);pcan_p 0;}
+pcan_38();pcan_29(&((pcan_c* )pcan_b)->pcan_5);pcan_q 0;}
--- a/drivers/can_peak_win32/cobf.h Tue Aug 08 22:34:32 2006 +0200
+++ b/drivers/can_peak_win32/cobf.h Thu Aug 10 08:53:05 2006 +0200
@@ -22,76 +22,78 @@
//****************************************************************************
/*
- Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Tue Aug 8 23:36:30 2006
+ Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Wed Aug 9 08:28:43 2006
*/
-#define pcan_34 typedef
-#define pcan_51 struct
-#define pcan_9 char
-#define pcan_39 TASK_HANDLE
-#define pcan_1 receiveTask
-#define pcan_24 CO_Data
-#define pcan_o d
-#define pcan_16 s_BOARD
-#define pcan_k board
-#define pcan_47 pthread_mutex_t
-#define pcan_38 PTHREAD_MUTEX_INITIALIZER
-#define pcan_12 void
-#define pcan_n CAN_HANDLE
+#define pcan_o getenv
+#define pcan_6 strtol
+#define pcan_v NULL
+#define pcan_37 typedef
+#define pcan_53 struct
+#define pcan_11 char
+#define pcan_41 TASK_HANDLE
+#define pcan_5 receiveTask
+#define pcan_26 CO_Data
+#define pcan_s d
+#define pcan_27 s_BOARD
+#define pcan_l board
+#define pcan_48 pthread_mutex_t
+#define pcan_40 PTHREAD_MUTEX_INITIALIZER
+#define pcan_14 void
+#define pcan_m CAN_HANDLE
#define pcan_d if
-#define pcan_52 CAN2_Init
+#define pcan_55 CAN2_Init
#define pcan_20 baudrate
-#define pcan_v CAN_INIT_TYPE_ST
+#define pcan_y CAN_INIT_TYPE_ST
#define pcan_j else
-#define pcan_54 CAN_Init
-#define pcan_t UNS8
+#define pcan_57 CAN_Init
+#define pcan_u UNS8
#define pcan_17 canReceive
-#define pcan_4 Message
+#define pcan_8 Message
#define pcan_f data
-#define pcan_23 TPCANMsg
-#define pcan_11 DWORD
-#define pcan_22 pthread_mutex_lock
-#define pcan_27 CAN2_Read
-#define pcan_48 CAN_Read
+#define pcan_24 TPCANMsg
+#define pcan_13 DWORD
+#define pcan_19 pthread_mutex_lock
+#define pcan_31 CAN2_Read
+#define pcan_51 CAN_Read
#define pcan_w CAN_ERR_OK
-#define pcan_q MSGTYPE
-#define pcan_14 MSGTYPE_STANDARD
-#define pcan_10 MSGTYPE_RTR
-#define pcan_25 CAN_ERR_BUSOFF
-#define pcan_7 printf
-#define pcan_y usleep
-#define pcan_u pthread_mutex_unlock
-#define pcan_p return
-#define pcan_28 MSGTYPE_STATUS
-#define pcan_8 DATA
-#define pcan_46 CAN_ERR_OVERRUN
-#define pcan_13 cob_id
-#define pcan_15 w
+#define pcan_n MSGTYPE
+#define pcan_28 MSGTYPE_STANDARD
+#define pcan_15 MSGTYPE_RTR
+#define pcan_23 CAN_ERR_BUSOFF
+#define pcan_2 printf
+#define pcan_x usleep
+#define pcan_z pthread_mutex_unlock
+#define pcan_q return
+#define pcan_32 MSGTYPE_STATUS
+#define pcan_12 DATA
+#define pcan_50 CAN_ERR_OVERRUN
+#define pcan_16 cob_id
+#define pcan_25 w
#define pcan_18 ID
-#define pcan_2 rtr
-#define pcan_z len
-#define pcan_6 LEN
+#define pcan_9 rtr
+#define pcan_1 len
+#define pcan_7 LEN
#define pcan_3 for
-#define pcan_44 canReceiveLoop
-#define pcan_19 while
-#define pcan_26 EnterMutex
-#define pcan_50 canDispatch
-#define pcan_30 LeaveMutex
-#define pcan_31 CAN_ERR_QRCVEMPTY
-#define pcan_40 CAN_ERR_BUSLIGHT
-#define pcan_45 CAN_ERR_BUSHEAVY
-#define pcan_41 canSend
-#define pcan_m errno
-#define pcan_32 do
-#define pcan_53 CAN2_Write
-#define pcan_43 CAN_Write
-#define pcan_42 canOpen
-#define pcan_21 int
-#define pcan_56 break
-#define pcan_0 fprintf
-#define pcan_5 stderr
-#define pcan_37 NULL
-#define pcan_29 CreateReceiveTask
-#define pcan_57 canClose
-#define pcan_49 CAN2_Close
-#define pcan_35 CAN_Close
-#define pcan_33 WaitReceiveTaskEnd
+#define pcan_47 canReceiveLoop
+#define pcan_21 while
+#define pcan_30 EnterMutex
+#define pcan_54 canDispatch
+#define pcan_35 LeaveMutex
+#define pcan_33 CAN_ERR_QRCVEMPTY
+#define pcan_42 CAN_ERR_BUSLIGHT
+#define pcan_49 CAN_ERR_BUSHEAVY
+#define pcan_43 canSend
+#define pcan_p errno
+#define pcan_36 do
+#define pcan_56 CAN2_Write
+#define pcan_46 CAN_Write
+#define pcan_44 canOpen
+#define pcan_22 int
+#define pcan_45 break
+#define pcan_4 fprintf
+#define pcan_10 stderr
+#define pcan_34 CreateReceiveTask
+#define pcan_59 canClose
+#define pcan_52 CAN2_Close
+#define pcan_38 CAN_Close
+#define pcan_29 WaitReceiveTaskEnd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/can_peak_win32/.cvsignore Thu Aug 10 08:53:05 2006 +0200
@@ -0,0 +1,1 @@
+cancfg.h