From 40c17b3af46339be8f27402b7b92652f1794017e Mon Sep 17 00:00:00 2001 From: scipio Date: Wed, 1 Jul 2009 19:26:59 +0000 Subject: [PATCH] Add TOS_SLEEP_NONE enum so components can prevent low power states. --- tos/platforms/btnode3/hardware.h | 6 ++++++ tos/platforms/epic/hardware.h | 6 ++++++ tos/platforms/eyesIFX/eyesIFXv1/hardware.h | 6 ++++++ tos/platforms/eyesIFX/eyesIFXv2/hardware.h | 6 ++++++ tos/platforms/intelmote2/hardware.h | 9 +++++++++ tos/platforms/mica2/hardware.h | 6 ++++++ tos/platforms/mica2dot/hardware.h | 6 ++++++ tos/platforms/micaz/hardware.h | 6 ++++++ tos/platforms/null/hardware.h | 8 ++++++++ tos/platforms/shimmer/hardware.h | 6 ++++++ tos/platforms/telosa/hardware.h | 6 ++++++ tos/platforms/telosb/hardware.h | 9 ++++++--- tos/platforms/tinynode/hardware.h | 5 +++++ 13 files changed, 82 insertions(+), 3 deletions(-) diff --git a/tos/platforms/btnode3/hardware.h b/tos/platforms/btnode3/hardware.h index 14103ceb..99484b8b 100644 --- a/tos/platforms/btnode3/hardware.h +++ b/tos/platforms/btnode3/hardware.h @@ -53,6 +53,12 @@ #include #include +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = ATM128_POWER_IDLE, +}; + // A/D constants (channels, etc) enum { CHANNEL_RSSI = ATM128_ADC_SNGL_ADC2, diff --git a/tos/platforms/epic/hardware.h b/tos/platforms/epic/hardware.h index c295356e..e69eb74e 100644 --- a/tos/platforms/epic/hardware.h +++ b/tos/platforms/epic/hardware.h @@ -42,6 +42,12 @@ #include "msp430hardware.h" +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; + // LEDS TOSH_ASSIGN_PIN(RED_LED, 4, 0); TOSH_ASSIGN_PIN(GREEN_LED, 4, 3); diff --git a/tos/platforms/eyesIFX/eyesIFXv1/hardware.h b/tos/platforms/eyesIFX/eyesIFXv1/hardware.h index 8c1e786b..91c4f306 100644 --- a/tos/platforms/eyesIFX/eyesIFXv1/hardware.h +++ b/tos/platforms/eyesIFX/eyesIFXv1/hardware.h @@ -35,6 +35,12 @@ #include "msp430hardware.h" +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; + // LED assignments TOSH_ASSIGN_PIN(RED_LED, 5, 0); // Compatibility with the mica2 TOSH_ASSIGN_PIN(GREEN_LED, 5, 1); diff --git a/tos/platforms/eyesIFX/eyesIFXv2/hardware.h b/tos/platforms/eyesIFX/eyesIFXv2/hardware.h index 212e4d8f..92b29b03 100644 --- a/tos/platforms/eyesIFX/eyesIFXv2/hardware.h +++ b/tos/platforms/eyesIFX/eyesIFXv2/hardware.h @@ -35,6 +35,12 @@ #include "msp430hardware.h" +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; + // LED assignments TOSH_ASSIGN_PIN(RED_LED, 5, 0); // Compatibility with the mica2 TOSH_ASSIGN_PIN(GREEN_LED, 5, 1); diff --git a/tos/platforms/intelmote2/hardware.h b/tos/platforms/intelmote2/hardware.h index b6cb5d8b..3ff83b7b 100644 --- a/tos/platforms/intelmote2/hardware.h +++ b/tos/platforms/intelmote2/hardware.h @@ -100,6 +100,15 @@ #include "pxa27xhardware.h" //#include "AM.h" +// enum so components can override power saving, +// as per TEP 112. +// Note that currently the pxa27x does not support +// McuPowerOverride, so SLEEP_NONE is defined to +// be 0. +enum { + TOS_SLEEP_NONE = 0, +}; + #define MIN(a,b) ((a) < (b) ? (a) : (b)) /* Watchdog Prescaler diff --git a/tos/platforms/mica2/hardware.h b/tos/platforms/mica2/hardware.h index c3dc7a9a..bfd66849 100644 --- a/tos/platforms/mica2/hardware.h +++ b/tos/platforms/mica2/hardware.h @@ -51,6 +51,12 @@ #include #include +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = ATM128_POWER_IDLE, +}; + // A/D channels enum { CHANNEL_RSSI = ATM128_ADC_SNGL_ADC0, diff --git a/tos/platforms/mica2dot/hardware.h b/tos/platforms/mica2dot/hardware.h index fa578851..d59f5671 100644 --- a/tos/platforms/mica2dot/hardware.h +++ b/tos/platforms/mica2dot/hardware.h @@ -51,6 +51,12 @@ #include #include +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = ATM128_POWER_IDLE, +}; + // A/D channels enum { CHANNEL_RSSI = ATM128_ADC_SNGL_ADC0, diff --git a/tos/platforms/micaz/hardware.h b/tos/platforms/micaz/hardware.h index c21554a0..3276ed89 100644 --- a/tos/platforms/micaz/hardware.h +++ b/tos/platforms/micaz/hardware.h @@ -51,6 +51,12 @@ #include #include +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = ATM128_POWER_IDLE, +}; + // A/D channels enum { CHANNEL_THERMISTOR = ATM128_ADC_SNGL_ADC1 // normally unpopulated diff --git a/tos/platforms/null/hardware.h b/tos/platforms/null/hardware.h index 2321cb15..59da9bc7 100644 --- a/tos/platforms/null/hardware.h +++ b/tos/platforms/null/hardware.h @@ -28,4 +28,12 @@ inline float __nesc_hton_afloat(void *COUNT(sizeof(float)) target, float value) 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 diff --git a/tos/platforms/shimmer/hardware.h b/tos/platforms/shimmer/hardware.h index d4769930..71de14f3 100644 --- a/tos/platforms/shimmer/hardware.h +++ b/tos/platforms/shimmer/hardware.h @@ -40,6 +40,12 @@ #define SHIMMER 1 +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; + // LEDs TOSH_ASSIGN_PIN(RED_LED, 4, 0); TOSH_ASSIGN_PIN(ORANGE_LED, 4, 1); diff --git a/tos/platforms/telosa/hardware.h b/tos/platforms/telosa/hardware.h index 405ba4f3..b1b19395 100644 --- a/tos/platforms/telosa/hardware.h +++ b/tos/platforms/telosa/hardware.h @@ -4,6 +4,12 @@ #include "msp430hardware.h" +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; + // LEDs TOSH_ASSIGN_PIN(RED_LED, 5, 4); TOSH_ASSIGN_PIN(GREEN_LED, 5, 5); diff --git a/tos/platforms/telosb/hardware.h b/tos/platforms/telosb/hardware.h index 8b720fa2..50bac246 100644 --- a/tos/platforms/telosb/hardware.h +++ b/tos/platforms/telosb/hardware.h @@ -2,9 +2,12 @@ #define _H_hardware_h #include "msp430hardware.h" -//#include "MSP430ADC12.h" -//#include "CC2420Const.h" -//#include "AM.h" + +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; // LEDs TOSH_ASSIGN_PIN(RED_LED, 5, 4); diff --git a/tos/platforms/tinynode/hardware.h b/tos/platforms/tinynode/hardware.h index eaa80051..b5a939cd 100644 --- a/tos/platforms/tinynode/hardware.h +++ b/tos/platforms/tinynode/hardware.h @@ -44,6 +44,11 @@ #include "msp430hardware.h" +// enum so components can override power saving, +// as per TEP 112. +enum { + TOS_SLEEP_NONE = MSP430_POWER_ACTIVE, +}; // XE1205 radio TOSH_ASSIGN_PIN(NSS_DATA, 1, 0); -- 2.39.2