]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/timer/Msp430TimerCapComP.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / chips / msp430 / timer / Msp430TimerCapComP.nc
index 04707adf3d207c471666781be0a7897ad222579e..52355369c72ac061da5169356856f51e9594088c 100644 (file)
@@ -28,7 +28,7 @@
 generic module Msp430TimerCapComP(
     uint16_t TxCCTLx_addr,
     uint16_t TxCCRx_addr
-  )
+  ) @safe()
 {
   provides interface Msp430TimerControl as Control;
   provides interface Msp430Compare as Compare;
@@ -38,8 +38,8 @@ generic module Msp430TimerCapComP(
 }
 implementation
 {
-  #define TxCCTLx (*TCAST(volatile TYPE_TACCTL0* SINGLE NONNULL, TxCCTLx_addr))
-  #define TxCCRx (*TCAST(volatile TYPE_TACCR0* SINGLE NONNULL, TxCCRx_addr))
+  #define TxCCTLx (*TCAST(volatile TYPE_TACCTL0* ONE, TxCCTLx_addr))
+  #define TxCCRx (*TCAST(volatile TYPE_TACCR0* ONE, TxCCRx_addr))
 
   typedef msp430_compare_control_t cc_t;
 
@@ -61,11 +61,11 @@ implementation
   uint16_t captureControl(uint8_t l_cm)
   {
     cc_t x = {
-      cm : l_cm & 0x03,    // capture on rising edge
+      cm : l_cm & 0x03,  // capture on none, rising, falling or both edges
       ccis : 0,  // capture/compare input select
       clld : 0,  // TBCL1 loads on write to TBCCR1
       cap : 1,   // compare mode
-      scs : 1,   // synchronous capture mode
+      scs : 0,   // non synchronous capture mode
       ccie : 0,  // capture compare interrupt enable
     };
     return CC2int(x);