]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Remove references to Alarm; use of a Timer will be fine.
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Mon, 9 Nov 2009 19:30:51 +0000 (19:30 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 03:01:49 +0000 (20:01 -0700)
tos/platforms/tmirws/sensors/AeroVaneReadC.nc
tos/platforms/tmirws/sensors/AeroVaneReadP.nc

index 01fa7d50d65eb3133d9ba964626d51c29584a31c..1b2fcf2e84d4e919f6a7eecb56a6637f205c8889 100644 (file)
@@ -40,20 +40,11 @@ configuration AeroVaneReadC {
   provides interface Notify<aerovector_t>;
 }
 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;
index 906679b7e89ee22fa9cc74624de64b71ee137e8d..c620006e693ccc1dbd0f114e44c6879f8c1c60f9 100644 (file)
 generic module AeroVaneReadP(uint16_t period) {
   provides interface Notify<aerovector_t>;
   uses {
-#if 0
-    interface Alarm<T32khz, uint16_t>;
-#else
     interface Timer<TMilli>;
-#endif
     interface Read<uint16_t>;
     interface StdControl as AnemometerControl;
     interface AsyncGet<uint16_t> 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();
   }