Code clean-up and fixed xenomai compile problem
authorlbessard
Fri, 16 Jun 2006 14:24:59 +0200
changeset 31 a82b70738e5c
parent 30 a5dd050b28cb
child 32 8afa33692372
Code clean-up and fixed xenomai compile problem
configure
examples/TestMasterSlave/TestMasterSlave.c
examples/TestMasterSlave/TestMasterSlave.h
src/led.c
src/sdo.c
src/sync.c
--- a/configure	Tue Jun 13 16:05:57 2006 +0200
+++ b/configure	Fri Jun 16 14:24:59 2006 +0200
@@ -131,7 +131,7 @@
 		echo	"		\"hcs12\" for HCS12 micro-controller"
 		echo	"		\"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" 
 		echo 	" --can=foo	Use 'foo' as CAN driver (can be either 'peak', 'lincan' or 'virtual')"
-		echo 	" --timers=foo	Use 'foo' as TIMERS driver (can be either 'unix' or 'xenomai')"
+		echo 	" --timers=foo	Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
 		echo	" --led=foo	Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')"
 		echo	" --nvram=foo	Use 'foo' as NVRAM driver (use 'none' to disable or 'file')"
 		echo	" --disable-Ox	Disable gcc \"-Ox\" optimizations."
@@ -450,6 +450,9 @@
 #### CAN_DRIVER ####
 
 if [ "$SUB_CAN_DRIVER" = "peak" ]; then
+    if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then
+    	SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lrtdm
+    fi
 	SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpcan
 fi
 
--- a/examples/TestMasterSlave/TestMasterSlave.c	Tue Jun 13 16:05:57 2006 +0200
+++ b/examples/TestMasterSlave/TestMasterSlave.c	Fri Jun 16 14:24:59 2006 +0200
@@ -66,6 +66,7 @@
 UNS32 OnMasterMap1Update(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex)
 {
 	eprintf("OnSlaveMap1Update:%d\n", SlaveMap1);
+	return 0;
 }
 
 
@@ -134,7 +135,7 @@
   printf("*   If you have chosen virtual CAN driver, just type         *\n");
   printf("*   ./TestMasterSlave                                        *\n");
   printf("*                                                            *\n");
-  printf("*   Else you need to sepcify bus:                            *\n");
+  printf("*   Else you need to specify bus:                            *\n");
   printf("*                                                            *\n");
   printf("*     -s : slave CAN bus [default 0, peak first PCI]         *\n");
   printf("*     -m : master CAN bus [default 1, peak second PCI]       *\n");
--- a/examples/TestMasterSlave/TestMasterSlave.h	Tue Jun 13 16:05:57 2006 +0200
+++ b/examples/TestMasterSlave/TestMasterSlave.h	Fri Jun 16 14:24:59 2006 +0200
@@ -26,6 +26,8 @@
 #endif
 void print_message(Message *m);
 
+UNS8 canSend(CAN_HANDLE fd0, Message *m);
+
 extern CAN_HANDLE SlaveCanHandle;
 extern CAN_HANDLE MasterCanHandle;
 
--- a/src/led.c	Tue Jun 13 16:05:57 2006 +0200
+++ b/src/led.c	Fri Jun 16 14:24:59 2006 +0200
@@ -42,6 +42,7 @@
 void led_set_green(UNS8 on);
 void led_set_red(UNS8 on);
 void led_callback(CO_Data* d, UNS32 id);
+void led_set_redgreen(CO_Data *d, unsigned char state);
 
 
 // 0 = always off, 1 = always on, 2 = flashing
--- a/src/sdo.c	Tue Jun 13 16:05:57 2006 +0200
+++ b/src/sdo.c	Fri Jun 16 14:24:59 2006 +0200
@@ -112,8 +112,6 @@
 /***************************************************************************/
 UNS32 SDOlineToObjdict (CO_Data* d, UNS8 line)
 {
-  const indextable *ptrTable;
-  UNS8 i;
   UNS8      size;
   UNS32 errorCode;
   MSG_WAR(0x3A08, "Enter in SDOlineToObjdict ", line);
@@ -130,8 +128,6 @@
 /***************************************************************************/
 UNS32 objdictToSDOline (CO_Data* d, UNS8 line)
 {
-  UNS8  j;
-//  UNS8  *data;
   UNS8  size = 0;
   UNS8  dataType;
   UNS32 errorCode;
--- a/src/sync.c	Tue Jun 13 16:05:57 2006 +0200
+++ b/src/sync.c	Fri Jun 16 14:24:59 2006 +0200
@@ -32,6 +32,7 @@
 UNS32 OnCOB_ID_SyncUpdate(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex)
 {
 	startSYNC(d);
+	return 0;
 }
 
 void startSYNC(CO_Data* d)