]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
nx_float support
authoridgay <idgay>
Sat, 20 Sep 2008 00:10:18 +0000 (00:10 +0000)
committeridgay <idgay>
Sat, 20 Sep 2008 00:10:18 +0000 (00:10 +0000)
tos/chips/atm128/atm128hardware.h
tos/chips/msp430/msp430hardware.h

index 32c1c8e310a0fa24063ffc5c68a72f15d3546de8..b412d90fe1a7c74c1110d130db91151f39f1a317 100644 (file)
@@ -135,7 +135,12 @@ mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) @safe() {
   return (m1 < m2)? m1: m2;
 }
 
-/* Floating-point network-type support */
+/* Floating-point network-type support.
+   These functions must convert to/from a 32-bit big-endian integer that follows
+   the layout of Java's java.lang.float.floatToRawIntBits method.
+   Conveniently, for the AVR family, this is a straight byte copy...
+*/
+
 typedef float nx_float __attribute__((nx_base_be(afloat)));
 
 inline float __nesc_ntoh_afloat(const void *COUNT(sizeof(float)) source) @safe() {
index 829f2bd8cc8ff2d332f5930266427b702c7d8dea..ac18b26cb0b43a305179760b164b801649e7156e 100644 (file)
@@ -239,7 +239,12 @@ void __nesc_atomic_end(__nesc_atomic_t reenable_interrupts) @spontaneous() @safe
 }
 #endif
 
-/* Floating-point network-type support */
+/* Floating-point network-type support.
+   These functions must convert to/from a 32-bit big-endian integer that follows
+   the layout of Java's java.lang.float.floatToRawIntBits method.
+   Conveniently, for the MSP430 family, this is a straight byte copy...
+*/
+
 typedef float nx_float __attribute__((nx_base_be(afloat)));
 
 inline float __nesc_ntoh_afloat(const void *COUNT(sizeof(float)) source) @safe() {