From: liang_mike Date: Thu, 29 Oct 2009 01:31:28 +0000 (+0000) Subject: Fix problem where TinyLD example apps only complied successfully for Telosb X-Git-Tag: rc_6_tinyos_2_1_1~166 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=840d86fce44ded21daf824bf00c083874a1d9519 Fix problem where TinyLD example apps only complied successfully for Telosb --- diff --git a/support/make/threads.extra b/support/make/threads.extra index 50e21d3e..17adba17 100644 --- a/support/make/threads.extra +++ b/support/make/threads.extra @@ -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 - diff --git a/tos/lib/tosthreads/lib/tinyld/slcs_types.h b/tos/lib/tosthreads/lib/tinyld/slcs_types.h index 319add1e..15e43383 100755 --- a/tos/lib/tosthreads/lib/tinyld/slcs_types.h +++ b/tos/lib/tosthreads/lib/tinyld/slcs_types.h @@ -31,9 +31,12 @@ #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" diff --git a/tos/lib/tosthreads/lib/tinyld/tosthread_slcs_types.h b/tos/lib/tosthreads/lib/tinyld/tosthread_slcs_types.h index 1b14c0c2..f17e3256 100755 --- a/tos/lib/tosthreads/lib/tinyld/tosthread_slcs_types.h +++ b/tos/lib/tosthreads/lib/tinyld/tosthread_slcs_types.h @@ -27,24 +27,8 @@ #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}, diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrC.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrC.nc index e90f0e59..1c75d720 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrC.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrC.nc @@ -36,9 +36,11 @@ configuration CHamamatsuS10871TsrC {} implementation { components CHamamatsuS10871TsrP; +#ifdef PLATFORM_TELOSB components new BlockingHamamatsuS10871TsrC(); CHamamatsuS10871TsrP.DeviceMetadata -> BlockingHamamatsuS10871TsrC.DeviceMetadata; CHamamatsuS10871TsrP.Read -> BlockingHamamatsuS10871TsrC.Read; CHamamatsuS10871TsrP.ReadStream -> BlockingHamamatsuS10871TsrC.ReadStream; +#endif } diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrP.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrP.nc index 84d43ac4..da4bfa9f 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrP.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS10871TsrP.nc @@ -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; + } } diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParC.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParC.nc index 8466647d..a4a020d1 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParC.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParC.nc @@ -36,9 +36,11 @@ configuration CHamamatsuS1087ParC {} implementation { components CHamamatsuS1087ParP; +#ifdef PLATFORM_TELOSB components new BlockingHamamatsuS1087ParC(); CHamamatsuS1087ParP.DeviceMetadata -> BlockingHamamatsuS1087ParC.DeviceMetadata; CHamamatsuS1087ParP.Read -> BlockingHamamatsuS1087ParC.Read; CHamamatsuS1087ParP.ReadStream -> BlockingHamamatsuS1087ParC.ReadStream; +#endif } diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParP.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParP.nc index 6afd3f77..bd45a932 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParP.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CHamamatsuS1087ParP.nc @@ -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; + } } diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11C.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11C.nc index b30196e2..52d9623b 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11C.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11C.nc @@ -36,10 +36,12 @@ 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 } diff --git a/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11P.nc b/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11P.nc index 1e478ab8..448d6681 100644 --- a/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11P.nc +++ b/tos/lib/tosthreads/sensorboards/tmote_onboard/CSensirionSht11P.nc @@ -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; + } }