paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [4765] fix doubles support


From: Pascal Brisset
Subject: [paparazzi-commits] [4765] fix doubles support
Date: Tue, 30 Mar 2010 09:58:26 +0000

Revision: 4765
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4765
Author:   hecto
Date:     2010-03-30 09:58:26 +0000 (Tue, 30 Mar 2010)
Log Message:
-----------
 fix doubles support

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/pprz_transport.h

Modified: paparazzi3/trunk/sw/airborne/pprz_transport.h
===================================================================
--- paparazzi3/trunk/sw/airborne/pprz_transport.h       2010-03-30 09:58:04 UTC 
(rev 4764)
+++ paparazzi3/trunk/sw/airborne/pprz_transport.h       2010-03-30 09:58:26 UTC 
(rev 4765)
@@ -94,10 +94,17 @@
     PprzTransportPut2ByteByAddr((const uint8_t*)_byte+2);      \
   }
 
-#define PprzTransportPut8ByteByAddr(_byte) { \
-    PprzTransportPut4ByteByAddr(_byte);        \
+#ifdef __IEEE_BIG_ENDIAN /* From machine/ieeefp.h */
+#define PprzTransportPutDoubleByAddr(_byte) { \
     PprzTransportPut4ByteByAddr((const uint8_t*)_byte+4);      \
+    PprzTransportPut4ByteByAddr((const uint8_t*)_byte);        \
   }
+#else
+#define PprzTransportPutDoubleByAddr(_byte) { \
+    PprzTransportPut4ByteByAddr((const uint8_t*)_byte);        \
+    PprzTransportPut4ByteByAddr((const uint8_t*)_byte+4);      \
+  }
+#endif
 
 
 #define PprzTransportPutInt8ByAddr(_x) PprzTransportPut1ByteByAddr(_x)
@@ -107,7 +114,6 @@
 #define PprzTransportPutInt32ByAddr(_x) PprzTransportPut4ByteByAddr((const 
uint8_t*)_x)
 #define PprzTransportPutUint32ByAddr(_x) PprzTransportPut4ByteByAddr((const 
uint8_t*)_x)
 #define PprzTransportPutFloatByAddr(_x) PprzTransportPut4ByteByAddr((const 
uint8_t*)_x)
-#define PprzTransportPutDoubleByAddr(_x) PprzTransportPut8ByteByAddr((const 
uint8_t*)_x)
 
 #define PprzTransportPutArray(_put, _n, _x) { \
   uint8_t _i; \
@@ -118,6 +124,7 @@
 }
 
 #define PprzTransportPutFloatArray(_n, _x) 
PprzTransportPutArray(PprzTransportPutFloatByAddr, _n, _x)
+#define PprzTransportPutDoubleArray(_n, _x) 
PprzTransportPutArray(PprzTransportPutDoubleByAddr, _n, _x)
 
 #define PprzTransportPutInt16Array(_n, _x) 
PprzTransportPutArray(PprzTransportPutInt16ByAddr, _n, _x)
 #define PprzTransportPutUint16Array(_n, _x) 
PprzTransportPutArray(PprzTransportPutUint16ByAddr, _n, _x)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]