]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
When using a Timer in AeroVaneReadP, we don't need to post a task to read vane.
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Mon, 9 Nov 2009 19:30:50 +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/AeroVaneReadP.nc

index 319614ace68334b4094af5ab7367cc3234c94751..906679b7e89ee22fa9cc74624de64b71ee137e8d 100644 (file)
@@ -62,8 +62,6 @@ implementation {
   int m_vane;
   int m_sum;
 
-  task void readVane();
-
   void init()
   {
     m_count = 0;
@@ -100,18 +98,21 @@ implementation {
   }
 
 #if 0
+  task void readVane();
+
   async event void Alarm.fired()
-#else
-  event void Timer.fired()
-#endif
   {
-    //call Alarm.start(call Alarm.getAlarm() + period);
+    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();
   }