From 0f58276b9e5d322d87624bd7c11ff7eb5c2c8b57 Mon Sep 17 00:00:00 2001 From: smckown Date: Mon, 9 Nov 2009 19:30:51 +0000 Subject: [PATCH] Remove references to Alarm; use of a Timer will be fine. --- tos/platforms/tmirws/sensors/AeroVaneReadC.nc | 11 +------- tos/platforms/tmirws/sensors/AeroVaneReadP.nc | 28 +------------------ 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/tos/platforms/tmirws/sensors/AeroVaneReadC.nc b/tos/platforms/tmirws/sensors/AeroVaneReadC.nc index 01fa7d50..1b2fcf2e 100644 --- a/tos/platforms/tmirws/sensors/AeroVaneReadC.nc +++ b/tos/platforms/tmirws/sensors/AeroVaneReadC.nc @@ -40,20 +40,11 @@ configuration AeroVaneReadC { provides interface Notify; } implementation { -#if 0 - components new AeroVaneReadP(28800U); -#else - components new AeroVaneReadP(900); -#endif + components new AeroVaneReadP(900); /* 28800 clocks on 32768 Hz crystal */ Notify = AeroVaneReadP; -#if 0 - components new Alarm32khz16C(); - AeroVaneReadP.Alarm -> Alarm32khz16C; -#else components new TimerMilliC(); AeroVaneReadP.Timer -> TimerMilliC; -#endif components WindVaneReadC; AeroVaneReadP.Read -> WindVaneReadC; diff --git a/tos/platforms/tmirws/sensors/AeroVaneReadP.nc b/tos/platforms/tmirws/sensors/AeroVaneReadP.nc index 906679b7..c620006e 100644 --- a/tos/platforms/tmirws/sensors/AeroVaneReadP.nc +++ b/tos/platforms/tmirws/sensors/AeroVaneReadP.nc @@ -39,11 +39,7 @@ generic module AeroVaneReadP(uint16_t period) { provides interface Notify; uses { -#if 0 - interface Alarm; -#else interface Timer; -#endif interface Read; interface StdControl as AnemometerControl; interface AsyncGet as Count; @@ -76,43 +72,21 @@ implementation { init(); call AnemometerControl.start(); - /* FIXME: First alarm should be synced to top of the next second. How? */ -#if 0 - call Alarm.start(call Alarm.getNow() + period); -#else + /* FIXME: How to get first Timer.fired() synced with top of hour? */ call Timer.startPeriodic(period); -#endif return SUCCESS; } command error_t Notify.disable() { call State.toIdle(); -#if 0 - call Alarm.stop(); -#else call Timer.stop(); -#endif call AnemometerControl.stop(); return SUCCESS; } -#if 0 - task void readVane(); - - async event void Alarm.fired() - { - call Alarm.start(call Alarm.getAlarm() + period); - post readVane(); - } - - task void readVane() - { - //call Alarm.start(call Alarm.getAlarm() + period); -#else event void Timer.fired() { -#endif if (!(call State.isIdle())) call Read.read(); } -- 2.39.2