Workaround for unsupported UNS64 on some compiler.
authoretisserant
Mon, 12 Nov 2007 15:17:49 +0100
changeset 315 1d3bf87b8658
parent 314 68e83c3ffbb5
child 316 75691a663ec1
Workaround for unsupported UNS64 on some compiler.
include/hcs12/applicfg.h
src/pdo.c
--- a/include/hcs12/applicfg.h	Mon Nov 12 14:38:34 2007 +0100
+++ b/include/hcs12/applicfg.h	Mon Nov 12 15:17:49 2007 +0100
@@ -139,11 +139,13 @@
 #define UNS8   unsigned char
 #define UNS16  unsigned short
 #define UNS32  unsigned long
+/*
 #define UNS24
 #define UNS40
 #define UNS48
 #define UNS56
-#define UNS64 
+#define UNS64
+*/ 
 
 // Whatever your microcontroller, the timer wont work if 
 // TIMEVAL is not at least on 32 bits
--- a/src/pdo.c	Mon Nov 12 14:38:34 2007 +0100
+++ b/src/pdo.c	Mon Nov 12 15:17:49 2007 +0100
@@ -521,7 +521,12 @@
 	/*Compare new and old PDO*/
 	if(d->PDO_status[pdoNum].last_message.cob_id.w == pdo.cob_id.w &&
 	   d->PDO_status[pdoNum].last_message.len == pdo.len &&
+#ifdef UNS64
 	   *(UNS64*)(&d->PDO_status[pdoNum].last_message.data[0]) == *(UNS64*)(&pdo.data[0])){
+#else /* don't ALLOW_64BIT_OPS*/
+       *(UNS32*)(&d->PDO_status[pdoNum].last_message.data[0]) == *(UNS32*)(&pdo.data[0]) &&
+       *(UNS32*)(&d->PDO_status[pdoNum].last_message.data[4]) == *(UNS32*)(&pdo.data[4])){
+#endif 
 	   	/* No changes -> go to next pdo*/
 		status = state11;
 	}else{