]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/sensorboards/im2sb/Tsl2561InternalP.nc
Swapping HEAD and DEVEL branches
[tinyos-2.x.git] / tos / sensorboards / im2sb / Tsl2561InternalP.nc
index 0f6df7e550ebd97e74ee21dd6e4faa0efb71d79c..1bbbad46ccadc4bbde1efdf571bec79ff25c6d87 100644 (file)
  * @author Phil Buonadonna
  */
 module Tsl2561InternalP {
+  provides interface Init;
   provides interface HplTSL256x[uint8_t id];
+  uses interface Init as SubInit;
   uses interface HplTSL256x as ToHPLC;
+  uses interface GpioInterrupt as InterruptAlert;
 }
 
 implementation {
   uint8_t currentId;
   
+  command error_t Init.init() {
+    call SubInit.init();
+    // The Intel Mote 2 Sensorboard multiplexes the TSL interrupt through a NAND
+    // gate.  Need to overrid the edge trigger from the driver default
+    call InterruptAlert.enableRisingEdge();
+    return SUCCESS;
+  }
+
   command error_t HplTSL256x.measureCh0[uint8_t id]() {
     currentId = id;
     return call ToHPLC.measureCh0();
@@ -102,6 +113,8 @@ implementation {
     signal HplTSL256x.alertThreshold[currentId]();
   }
 
+  async event void InterruptAlert.fired() {}
+
   default async event void HplTSL256x.measureCh0Done[uint8_t id]( error_t error, uint16_t val ){ return; }
   default async event void HplTSL256x.measureCh1Done[uint8_t id]( error_t error, uint16_t val ){ return; }
   default async event void HplTSL256x.setCONTROLDone[uint8_t id]( error_t error ){ return; }