]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
indentation
authoridgay <idgay>
Fri, 2 May 2008 19:47:28 +0000 (19:47 +0000)
committeridgay <idgay>
Fri, 2 May 2008 19:47:28 +0000 (19:47 +0000)
tos/sensorboards/mts300/MicDeviceP.nc
tos/sensorboards/mts300/MicP.nc

index e12ac6a601adbd27c1d37ae4bae46ab5d58fbcbc..94d9420d9b97270f98afbfaab00c7e0e7e38ca3f 100644 (file)
@@ -39,14 +39,14 @@ configuration MicDeviceP {
 implementation {
   components MicP, MicaBusC, HplAtm128GeneralIOC as Pins,
     HplAtm128InterruptC as IntPins,
-               new Atm128I2CMasterC() as I2CPot,
-               new TimerMilliC() as WarmupTimer,
+    new Atm128I2CMasterC() as I2CPot,
+    new TimerMilliC() as WarmupTimer,
     new RoundRobinArbiterC(UQ_MIC_RESOURCE) as Arbiter,
     new SplitControlPowerManagerC() as PowerManager;
 
   Resource = Arbiter;
-       Atm128AdcConfig = MicP;
-       MicSetting = MicP;
+  Atm128AdcConfig = MicP;
+  MicSetting = MicP;
        
   PowerManager.ResourceDefaultOwner -> Arbiter;
   PowerManager.ArbiterInfo -> Arbiter;
index 4533631ca90bbfdd25f2d2a13cf2f66c424591bb..30038eac747d8077f0cc473cba94260f25dfb2e1 100644 (file)
@@ -37,9 +37,9 @@ module MicP
   provides interface Atm128AdcConfig as MicAtm128AdcConfig;
 
   uses interface Timer<TMilli>;
-       uses interface GeneralIO as MicPower;
-       uses interface GeneralIO as MicMuxSel;
-       uses interface MicaBusAdc as MicAdc;
+  uses interface GeneralIO as MicPower;
+  uses interface GeneralIO as MicMuxSel;
+  uses interface MicaBusAdc as MicAdc;
   uses interface I2CPacket<TI2CBasicAddr>;
   uses interface Resource as I2CResource;
   uses interface HplAtm128Interrupt as AlertInterrupt;
@@ -53,14 +53,13 @@ implementation
     call AlertInterrupt.disable();
     call MicPower.makeOutput();
     call MicPower.set();
-               call MicMuxSel.makeOutput();    
-               call MicMuxSel.clr();
+    call MicMuxSel.makeOutput();    
+    call MicMuxSel.clr();
                
     call MicSetting.muxSel(1);  // Set the mux so that raw microhpone output is selected
     call MicSetting.gainAdjust(64);  // Set the gain of the microphone.
 
     call Timer.startOneShot(1200); 
-//    signal SplitControl.startDone(SUCCESS);
     return SUCCESS;
   }
 
@@ -79,33 +78,30 @@ implementation
   }
   
   /**
-  * Resource request
-  * 
-  */  
+   * Resource request
+   
+   */  
   event void I2CResource.granted()
   {
-    if ( call I2CPacket.write(0x3,TOS_MIC_POT_ADDR, 2, gainData) == SUCCESS)
-    {
-      return;
-    };
+    call I2CPacket.write(0x3,TOS_MIC_POT_ADDR, 2, gainData);
   }
 
   /**
-  * mic control
-  * 
-  */  
+   * mic control
+   
+   */  
   command error_t MicSetting.muxSel(uint8_t sel)
   {
     if (sel == 0)
-    {
-      call MicMuxSel.clr();
-      return SUCCESS;
-    }
+      {
+       call MicMuxSel.clr();
+       return SUCCESS;
+      }
     else if (sel == 1)
-    {
-      call MicMuxSel.set();
-      return SUCCESS;
-    }
+      {
+       call MicMuxSel.set();
+       return SUCCESS;
+      }
     return FAIL;
   }
   
@@ -123,9 +119,9 @@ implementation
   }
   
   /**
-  * mic interrupt control
-  * 
-  */
+   * mic interrupt control
+   
+   */
   async command error_t MicSetting.enable()
   {
     call AlertInterrupt.enable();
@@ -149,9 +145,9 @@ implementation
   }
   
   /**
-  *
-  *
-  */
+   *
+   *
+   */
   
   async command uint8_t MicAtm128AdcConfig.getChannel() 
   {
@@ -169,18 +165,16 @@ implementation
   }
   
   /**
-  * I2CPot2
-  * 
-  */
+   * I2CPot2
+   
+   */
   async event void I2CPacket.readDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
   {
-    return ;
   }
   
   async event void I2CPacket.writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
   {
     call I2CResource.release();
-    return ;
   }
 }