CleanUp and minor fixes
authoretisserant
Sat, 12 May 2007 22:42:51 +0200
changeset 191 1e6e3d261b8f
parent 190 3248a2d6bb0b
child 192 9dd6f17ef7e5
CleanUp and minor fixes
drivers/can_lincan/Makefile.in
drivers/can_peak_linux/Makefile.in
drivers/can_peak_win32/Makefile.in
drivers/can_peak_win32/cobf.h
drivers/can_socket/Makefile.in
drivers/can_virtual/Makefile.in
examples/TestMasterMicroMod/TestMasterMicroMod.c
examples/TestMasterSlave/TestMasterSlave.c
src/Makefile.in
src/dcf.c
--- a/drivers/can_lincan/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/drivers/can_lincan/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -52,7 +52,7 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 libcanfestival_$(CAN_DRIVER).so: $(OBJS)
-	gcc -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so -o $@ $<
+	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
 	mkdir -p $(PREFIX)/lib/
--- a/drivers/can_peak_linux/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/drivers/can_peak_linux/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -53,7 +53,7 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 libcanfestival_$(CAN_DRIVER).so: $(OBJS)
-	gcc -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
+	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
 	mkdir -p $(PREFIX)/lib/
--- a/drivers/can_peak_win32/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/drivers/can_peak_win32/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -53,7 +53,7 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 cyg$(CAN_DRIVER).dll: $(OBJS)
-	gcc -shared -o $@ \
+	$(CC) -shared -o $@ \
 	-Wl,--export-all-symbols \
 	-Wl,--enable-auto-import \
 	-Wl,--whole-archive $< \
--- a/drivers/can_peak_win32/cobf.h	Fri May 11 18:34:54 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-
-This file is not part of CanFestival.
-This is third party contributed file.
-
-It is provided as-this and without any warranty
-
-*/
-
-//****************************************************************************
-// Copyright (C) 2006  PEAK System-Technik GmbH
-//
-// linux@peak-system.com
-// www.peak-system.com
-//
-// This part of software is proprietary. It is allowed to
-// distribute it with CanFestival. 
-//
-// No warranty at all is given.
-//
-// Maintainer(s): Edouard TISSERANT (edouard.tisserant@lolitech.fr)
-//****************************************************************************
-
-/*
-   Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Wed Aug  9 08:28:43 2006
-*/
-#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_55 CAN2_Init
-#define pcan_20 baudrate
-#define pcan_y CAN_INIT_TYPE_ST
-#define pcan_j else
-#define pcan_57 CAN_Init
-#define pcan_u UNS8
-#define pcan_17 canReceive
-#define pcan_8 Message
-#define pcan_f data
-#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_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_9 rtr
-#define pcan_1 len
-#define pcan_7 LEN
-#define pcan_3 for
-#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
--- a/drivers/can_socket/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/drivers/can_socket/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -53,7 +53,7 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 libcanfestival_$(CAN_DRIVER).so: $(OBJS)
-	gcc -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
+	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
 	mkdir -p $(PREFIX)/lib/
--- a/drivers/can_virtual/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/drivers/can_virtual/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -53,7 +53,7 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 libcanfestival_$(CAN_DRIVER).so: $(OBJS)
-	gcc -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
+	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
 	mkdir -p $(PREFIX)/lib/
--- a/examples/TestMasterMicroMod/TestMasterMicroMod.c	Fri May 11 18:34:54 2007 +0200
+++ b/examples/TestMasterMicroMod/TestMasterMicroMod.c	Sat May 12 22:42:51 2007 +0200
@@ -395,7 +395,7 @@
 int main(int argc,char **argv)
 {
 
-  char c;
+  int c;
   extern char *optarg;
   char* LibraryPath="libcanfestival_can_virtual.so";
   char *snodeid;
--- a/examples/TestMasterSlave/TestMasterSlave.c	Fri May 11 18:34:54 2007 +0200
+++ b/examples/TestMasterSlave/TestMasterSlave.c	Sat May 12 22:42:51 2007 +0200
@@ -119,7 +119,7 @@
 int main(int argc,char **argv)
 {
 
-  char c;
+  int c;
   extern char *optarg;
   char* LibraryPath="libcanfestival_can_virtual.so";
 
--- a/src/Makefile.in	Fri May 11 18:34:54 2007 +0200
+++ b/src/Makefile.in	Sat May 12 22:42:51 2007 +0200
@@ -31,7 +31,7 @@
 CAN_DRIVER = SUB_CAN_DRIVER
 TIMERS_DRIVER = SUB_TIMERS_DRIVER
 
-INCLUDES = -I../include -I../include/$(TARGET) -I../include/$(CAN_DRIVER) -I../include/$(TIMERS_DRIVER) -I../drivers/$(TARGET)
+INCLUDES = -I../include -I../include/$(TARGET) -I../include/$(TIMERS_DRIVER) -I../drivers/$(TARGET)
 
 OBJS = $(TARGET)_objacces.o $(TARGET)_lifegrd.o $(TARGET)_sdo.o\
 	    $(TARGET)_pdo.o $(TARGET)_sync.o $(TARGET)_nmtSlave.o $(TARGET)_nmtMaster.o $(TARGET)_states.o $(TARGET)_timer.o $(TARGET)_dcf.o
--- a/src/dcf.c	Fri May 11 18:34:54 2007 +0200
+++ b/src/dcf.c	Sat May 12 22:42:51 2007 +0200
@@ -28,18 +28,16 @@
 
 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId)
 {
-	UNS32 res;
-	UNS8 line;
-	UNS8 err;
-	UNS16 Index;
-	UNS8 SubIndex;
 	UNS32 abortCode;
 	
 	if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED)
-		printf("Master : Failed in initializing slave %2.2x, AbortCode :%4.4x \n", nodeId, abortCode);
-	
+	{
+		MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode);
+		MSG_WAR(0x2A02, "server node : ", nodeId);
+	}
+
 	closeSDOtransfer(d, nodeId, SDO_CLIENT);
-	res = decompo_dcf(d,nodeId);
+	decompo_dcf(d,nodeId);
 }
 
 UNS32 decompo_dcf(CO_Data* d,UNS8 nodeId)
@@ -48,7 +46,6 @@
 		UNS16 target_Index;
 		UNS8 target_Subindex;
 		UNS32 target_Size;
-		void* target_data = NULL;
 		UNS32 res;
   		ODCallback_t *Callback;
 
@@ -93,7 +90,7 @@
 				target_Size = *((UNS32*)(d->dcf_cursor)); d->dcf_cursor += 4;
 	#endif
 				
-					printf("Master : ConfigureSlaveNode %2.2x (Concise DCF)\n",nodeId);
+					/*printf("Master : ConfigureSlaveNode %2.2x (Concise DCF)\n",nodeId);*/
 					res = writeNetworkDictCallBack(d, /*CO_Data* d*/
 							nodeId, /*UNS8 nodeId*/
 							target_Index, /*UNS16 index*/