]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/null/hardware.h
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / platforms / null / hardware.h
index 4e2f7984303223d4f508b52cc39d20d1388f9063..59da9bc7215e8808ad47d9958faf815e2f23b792 100644 (file)
@@ -14,4 +14,26 @@ inline __nesc_atomic_t __nesc_atomic_start(void) @spontaneous() {
 inline void __nesc_atomic_end(__nesc_atomic_t x) @spontaneous() { }
 inline void __nesc_atomic_sleep() { }
 
+/* Floating-point network-type support */
+typedef float nx_float __attribute__((nx_base_be(afloat)));
+
+inline float __nesc_ntoh_afloat(const void *COUNT(sizeof(float)) source) @safe() {
+  float f;
+  memcpy(&f, source, sizeof(float));
+  return f;
+}
+
+inline float __nesc_hton_afloat(void *COUNT(sizeof(float)) target, float value) @safe() {
+  memcpy(target, &value, sizeof(float));
+  return value;
+}
+
+// enum so components can override power saving,
+// as per TEP 112.
+// As this is not a real platform, just set it to 0.
+enum {
+  TOS_SLEEP_NONE = 0,
+};
+
+
 #endif