]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/timer/Atm128AlarmAsyncC.nc
fixed capture time
[tinyos-2.x.git] / tos / chips / atm128 / timer / Atm128AlarmAsyncC.nc
index 6acee17c0e8df75ada1b9fcd02ddf40d81d2a0f9..67c1da4b6359e2e379ead441fe88b5afa492a544 100644 (file)
@@ -1,3 +1,25 @@
+// $Id$
+/*
+ * Copyright (c) 2007 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE     
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ * Build a 32-bit alarm and counter from the atmega128's 8-bit timer 0
+ * in asynchronous mode. Attempting to use the generic Atm128AlarmC
+ * component and the generic timer components runs into problems
+ * apparently related to letting timer 0 overflow.
+ * 
+ * So, instead, this version (inspired by the 1.x code and a remark from
+ * Martin Turon) directly builds a 32-bit alarm and counter on top of timer 0
+ * and never lets timer 0 overflow.
+ *
+ * @author David Gay
+ */
 generic configuration Atm128AlarmAsyncC(typedef precision, int divider) {
   provides {
     interface Init @atleastonce();
@@ -11,11 +33,11 @@ implementation
     HplAtm128Timer0AsyncC;
 
   Init = Atm128AlarmAsyncP;
-  Init = HplAtm128Timer0AsyncC;
   Alarm = Atm128AlarmAsyncP;
   Counter = Atm128AlarmAsyncP;
 
   Atm128AlarmAsyncP.Timer -> HplAtm128Timer0AsyncC;
   Atm128AlarmAsyncP.TimerCtrl -> HplAtm128Timer0AsyncC;
   Atm128AlarmAsyncP.Compare -> HplAtm128Timer0AsyncC;
+  Atm128AlarmAsyncP.TimerAsync -> HplAtm128Timer0AsyncC;
 }