X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fsensorboards%2Fim2sb%2FMAX136xInternalP.nc;h=ce873891c2d9e44256dd940fdfaa11daff314a91;hb=337d0b13acf569c2640b3ed7b7f5c7cec35d7ddd;hp=7c5e182cd12f3e204fe1fb9d26e27826b977b655;hpb=1a329382c4f4556fd52d85f4e3f4a67e54911682;p=tinyos-2.x.git diff --git a/tos/sensorboards/im2sb/MAX136xInternalP.nc b/tos/sensorboards/im2sb/MAX136xInternalP.nc index 7c5e182c..ce873891 100644 --- a/tos/sensorboards/im2sb/MAX136xInternalP.nc +++ b/tos/sensorboards/im2sb/MAX136xInternalP.nc @@ -34,13 +34,24 @@ * @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]() {}