]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fix problem where TinyLD example apps only complied successfully for Telosb
authorliang_mike <liang_mike>
Thu, 29 Oct 2009 01:31:28 +0000 (01:31 +0000)
committerliang_mike <liang_mike>
Thu, 29 Oct 2009 01:31:28 +0000 (01:31 +0000)
support/make/threads.extra
tos/lib/tosthreads/lib/tinyld/slcs_types.h
tos/lib/tosthreads/lib/tinyld/tosthread_slcs_types.h
tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrC.nc
tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrP.nc
tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParC.nc
tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParP.nc
tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11C.nc
tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11P.nc

index 50e21d3e95be35dde2edc0671a24ddb1d9b07a6d..17adba170ea7342e7e39a0c9c8b0ea47a691f783 100644 (file)
@@ -82,6 +82,12 @@ ifneq ($(filter telos telosa telosb tmote,$(MAKECMDGOALS)),)
   CFLAGS += $(THREADS_MSP430_INCLUDE_DIRS)
   CFLAGS += $(THREADS_CC2420_INCLUDE_DIRS)
   CFLAGS += $(THREADS_TELOS_INCLUDE_DIRS)
+  
+  #Since Telosb has some sensors not on other platforms, this helps us figure out
+  #what components should be included
+  ifneq ($(filter telosb,$(MAKECMDGOALS)),)
+    CFLAGS += -DPLATFORM_TELOSB
+  endif
 endif
 ifneq ($(filter mica2,$(MAKECMDGOALS)),)
   CFLAGS += $(THREADS_ATM128_INCLUDE_DIRS)
@@ -120,4 +126,3 @@ ifneq ($(filter shimmer,$(MAKECMDGOALS)),)
   CFLAGS += $(THREADS_CC2420_INCLUDE_DIRS)
   CFLAGS += $(THREADS_SHIMMER_INCLUDE_DIRS)
 endif
-
index 319add1ede681c70efd1ea35bd345cbffc6a34ea..15e43383405f5f1144d62589c149cbd8e6fc9876 100755 (executable)
 #include "tosthread_leds.h"
 #include "tosthread_amradio.h"
 #include "tosthread_blockstorage.h"
+#include "tosthread_logstorage.h"
+#include "tosthread_configstorage.h"
 #include "tosthread_threadsync.h"
 #include "tosthread_amserial.h"
 #include "tosthread_queue.h"
+
 #include "tosthread_sensirionSht11.h"
 #include "tosthread_hamamatsuS10871.h"
 #include "tosthread_hamamatsuS1087.h"
index 1b14c0c27525b472c311b3b61a7b3272f45d64fa..f17e3256dcd26a4870fde12c4d2dd3de9d3ebc12 100755 (executable)
 #ifndef _TOSTHREAD_SLCS_TYPES_H
 #define _TOSTHREAD_SLCS_TYPES_H
 
-#include "tosthread.h"
-#include "tosthread_leds.h"
-#include "tosthread_amradio.h"
-#include "tosthread_blockstorage.h"
-#include "tosthread_logstorage.h"
-#include "tosthread_configstorage.h"
-#include "tosthread_threadsync.h"
-#include "tosthread_amserial.h"
-#include "tosthread_queue.h"
-#include "tosthread_sensirionSht11.h"
-#include "tosthread_hamamatsuS10871.h"
-#include "tosthread_hamamatsuS1087.h"
-
-
-/*******************************/
 #include "slcs_types.h"
 
-
 struct addr fun[] = {
   
   {tosthread_sleep}, {tosthread_create},
@@ -91,7 +75,7 @@ struct addr fun[] = {
   {queue_init}, {queue_clear}, {queue_enqueue},
   {queue_dequeue}, {queue_remove}, {queue_size},
   {queue_is_empty},
-   
+
   {sensirionSht11_humidity_read}, {sensirionSht11_humidity_getNumBits}, {sensirionSht11_temperature_read},
   {sensirionSht11_temperature_getNumBits},
   
index e90f0e591300e96434c8b0b1c2bf6f3feea5b84c..1c75d720cb69b0a94f06a3a39befb4309d9d4e2c 100644 (file)
 configuration CHamamatsuS10871TsrC {}
 implementation {
   components CHamamatsuS10871TsrP;
+#ifdef PLATFORM_TELOSB
   components new BlockingHamamatsuS10871TsrC();
              
   CHamamatsuS10871TsrP.DeviceMetadata -> BlockingHamamatsuS10871TsrC.DeviceMetadata;
   CHamamatsuS10871TsrP.Read -> BlockingHamamatsuS10871TsrC.Read;
   CHamamatsuS10871TsrP.ReadStream -> BlockingHamamatsuS10871TsrC.ReadStream;
+#endif
 }
index 84d43ac46a966928865664abb82b3207b0ff83b0..da4bfa9f4d552470cf083f6a9a08f04bbb663bea 100644 (file)
@@ -50,4 +50,16 @@ implementation {
   uint8_t hamamatsuS10871_tsr_getNumBits() @C() AT_SPONTANEOUS {
     return call DeviceMetadata.getSignificantBits();
   }
+  
+  default command error_t Read.read(uint16_t* val) {
+    return FAIL;
+  }
+  
+  default command error_t ReadStream.read(uint32_t* usPeriod, uint16_t* buf, uint16_t count) {
+    return FAIL;
+  }
+  
+  default command uint8_t DeviceMetadata.getSignificantBits() {
+    return 0;
+  }
 }
index 8466647d5c9d52a3b88155960b1155a27e135371..a4a020d13ec294fd4ae56c589403098679bf791d 100644 (file)
 configuration CHamamatsuS1087ParC {}
 implementation {
   components CHamamatsuS1087ParP;
+#ifdef PLATFORM_TELOSB
   components new BlockingHamamatsuS1087ParC();
              
   CHamamatsuS1087ParP.DeviceMetadata -> BlockingHamamatsuS1087ParC.DeviceMetadata;
   CHamamatsuS1087ParP.Read -> BlockingHamamatsuS1087ParC.Read;
   CHamamatsuS1087ParP.ReadStream -> BlockingHamamatsuS1087ParC.ReadStream;
+#endif
 }
index 6afd3f77a2fc130b50ba00c5ffcb598166a73171..bd45a932614a2184151c4b7590e12592009b2bb0 100644 (file)
@@ -51,4 +51,16 @@ implementation {
   uint8_t hamamatsuS1087_par_getNumBits() @C() AT_SPONTANEOUS {
     return call DeviceMetadata.getSignificantBits();
   }
+  
+  default command error_t Read.read(uint16_t* val) {
+    return FAIL;
+  }
+  
+  default command error_t ReadStream.read(uint32_t* usPeriod, uint16_t* buf, uint16_t count) {
+    return FAIL;
+  }
+  
+  default command uint8_t DeviceMetadata.getSignificantBits() {
+    return 0;
+  }
 }
index b30196e2a7b79fcebd6324f47a24aab86b67884e..52d9623bbdc92fabeb3714e7bc4a89970a63748e 100644 (file)
 configuration CSensirionSht11C {}
 implementation {
   components CSensirionSht11P;
+#ifdef PLATFORM_TELOSB
   components new BlockingSensirionSht11C();
              
   CSensirionSht11P.Temperature -> BlockingSensirionSht11C.Temperature;
   CSensirionSht11P.TemperatureMetadata -> BlockingSensirionSht11C.TemperatureMetadata;
   CSensirionSht11P.Humidity -> BlockingSensirionSht11C.Humidity;
   CSensirionSht11P.HumidityMetadata -> BlockingSensirionSht11C.HumidityMetadata;
+#endif
 }
index 1e478ab81d5740cc1f892ff006d6702e97a47958..448d668150c326c3cec3506d5277d5ae2af9adeb 100644 (file)
@@ -54,4 +54,20 @@ implementation {
   uint8_t sensirionSht11_temperature_getNumBits() @C() AT_SPONTANEOUS {
     return call TemperatureMetadata.getSignificantBits();
   }
+  
+  default command error_t Humidity.read(uint16_t* val) {
+    return FAIL;
+  }
+
+  default command uint8_t HumidityMetadata.getSignificantBits() {
+    return 0;
+  }
+  
+  default command error_t Temperature.read(uint16_t* val) {
+    return FAIL;
+  }
+
+  default command uint8_t TemperatureMetadata.getSignificantBits() {
+    return 0;
+  }
 }