]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/timer/HplAtm128Timer1P.nc
fixed capture time
[tinyos-2.x.git] / tos / chips / atm128 / timer / HplAtm128Timer1P.nc
index adaa66dea1e7eb2bebc55e6782ce0af2b87ab7fa..f8070cf94d4145aee89deb0c02c357b730fbeb4d 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <Atm128Timer.h>
 
-module HplAtm128Timer1P
+module HplAtm128Timer1P @safe()
 {
   provides {
     // 16-bit Timers
@@ -66,13 +66,13 @@ implementation
 
   //=== Read the control registers. =====================================
   async command Atm128TimerCtrlCompare_t TimerCtrl.getCtrlCompare() { 
-    return *(Atm128TimerCtrlCompare_t*)&TCCR1A; 
+    return *(Atm128TimerCtrlCompare_t*ONE)&TCCR1A; 
   }
   async command Atm128TimerCtrlCapture_t TimerCtrl.getCtrlCapture() { 
-    return *(Atm128TimerCtrlCapture_t*)&TCCR1B; 
+    return *(Atm128TimerCtrlCapture_t*ONE)&TCCR1B; 
   }
   async command Atm128TimerCtrlClock_t TimerCtrl.getCtrlClock() { 
-    return *(Atm128TimerCtrlClock_t*)&TCCR1C; 
+    return *(Atm128TimerCtrlClock_t*ONE)&TCCR1C; 
   }
 
 
@@ -107,7 +107,7 @@ implementation
 
   //=== Read the interrupt flags. =====================================
   async command Atm128_ETIFR_t TimerCtrl.getInterruptFlag() { 
-    return *(Atm128_ETIFR_t*)&ETIFR; 
+    return *(Atm128_ETIFR_t*ONE)&ETIFR; 
   }
 
   //=== Write the interrupt flags. ====================================
@@ -205,7 +205,7 @@ implementation
   }
   default async event void Capture.captured(uint16_t time) { }
   AVR_NONATOMIC_HANDLER(SIG_INPUT_CAPTURE1) {
-    signal Capture.captured(call Timer.get());
+    signal Capture.captured(call Capture.get());
   }
   default async event void Timer.overflow() { }
   AVR_NONATOMIC_HANDLER(SIG_OVERFLOW1) {