sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
child 23 c26be94c8889
--- a/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Tue Aug 31 16:29:05 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Wed Sep 01 12:34:26 2010 +0100
@@ -280,6 +280,7 @@
                 {
                 property.iProperty.GetValue( iHzSamplingRate );
                 INFO_1( "Sampling rate changed to: %d", iHzSamplingRate );
+                iHasChanged = ETrue;
                 HandleStateEntryL();
                 }
             break;
@@ -354,8 +355,19 @@
     if( !iTimerToSend )
         {
         iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
+		iTimerToSend->Start();
         }
-	iTimerToSend->Start(iHzSamplingRate);
+    else if( iHasChanged )
+        {
+        delete iTimerToSend;
+        iTimerToSend = NULL;
+        iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
+        iHasChanged = EFalse;
+        }
+	else
+		{
+		iTimerToSend->Start();
+		}
     }
 
 // ----------------------------------------------------------------------------------
@@ -462,7 +474,7 @@
     else
     	{
     	if( iTimerToSend )
-    		iTimerToSend->Start(iHzSamplingRate);
+    		iTimerToSend->Start();
     	}
     }
 
@@ -500,11 +512,7 @@
 // CTCStateTiltListenData::CenrepValueChanged
 // -----------------------------------------------------------------------------
 //
-#ifdef _DEBUG
 void CTCStateTiltListenData::CenrepValueChanged( TUint32 aKey, CRepository& aRepository )
-#else
-void CTCStateTiltListenData::CenrepValueChanged( TUint32 /*aKey*/, CRepository& aRepository )
-#endif
     {
     FUNC_LOG;