]> 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 3c52c2a851fab5787f0774f1d7b9d0dcce9f8dcb..59da9bc7215e8808ad47d9958faf815e2f23b792 100644 (file)
@@ -1,7 +1,11 @@
+
+#ifndef HARDWARE_H
+#define HARDWARE_H
 inline void __nesc_enable_interrupt() { }
 inline void __nesc_disable_interrupt() { }
 
 typedef uint8_t __nesc_atomic_t;
+typedef uint8_t mcu_power_t;
 
 inline __nesc_atomic_t __nesc_atomic_start(void) @spontaneous() {
   return 0;
@@ -9,3 +13,27 @@ 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