]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/sensorboards/im2sb/MAX136xInternalP.nc
Swapping HEAD and DEVEL branches
[tinyos-2.x.git] / tos / sensorboards / im2sb / MAX136xInternalP.nc
index 7c5e182cd12f3e204fe1fb9d26e27826b977b655..ce873891c2d9e44256dd940fdfaa11daff314a91 100644 (file)
  * @author Phil Buonadonna
  */
 module MAX136xInternalP {
+  provides interface Init;
   provides interface HplMAX136x[uint8_t id];
+  uses interface Init as SubInit;
   uses interface HplMAX136x 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 MAX136 interrupt through a NAND
+    // gate.  Need to override the edge trigger from the driver default
+    call InterruptAlert.enableRisingEdge();
+    return SUCCESS;
+  }
+
   command error_t HplMAX136x.measureChannels[uint8_t id](uint8_t *buf, uint8_t len) {
     currentId = id;
     return call ToHPLC.measureChannels(buf, len);
@@ -66,6 +77,8 @@ implementation {
     signal HplMAX136x.readStatusDone[currentId](error, buf);
   }
 
+  async event void InterruptAlert.fired() {}
+
   default async event void HplMAX136x.measureChannelsDone[uint8_t id]( error_t error, uint8_t *buf, uint8_t len ) {}
   default async event void HplMAX136x.setConfigDone[uint8_t id]( error_t error , uint8_t *cfgbuf, uint8_t len) {}
   default async event void HplMAX136x.alertThreshold[uint8_t id]() {}