Update contrib.
2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include <drivers/mmc.h>
19 #include "stackbody.h"
21 DMMCStack::DBody::DBody(DMMCStack& aStack) :
23 iCurrentSelectedBusWidth( (TUint32)EBusWidthInvalid )
27 // Temporarily increase the idle timeout
28 void DMMCStack::DBody::SetInactivityTimeout(TInt aInactivityTimeout)
30 iStack.iSocket->ResetInactivity(0);
32 // save existing value - if not already saved (!)
33 if (iInactivityLock++ == 0)
35 iInactivityTimeout = iStack.iSocket->iVcc->iInactivityTimeout;
36 if (iStack.iSocket->iVccCore)
37 iVccCoreSleepTimeout = iStack.iSocket->iVccCore->iInactivityTimeout;
40 // set the new inactivity timeout to the maximum of the existing value and the specified value
41 TInt inactivityTimeout = Max(aInactivityTimeout, iInactivityTimeout);
42 iStack.iSocket->iVcc->iInactivityTimeout = inactivityTimeout;
43 if (iStack.iSocket->iVccCore)
44 // Sleep timeout should always be less than Vcc Inactivity timer
45 iStack.iSocket->iVccCore->iInactivityTimeout = inactivityTimeout;
48 void DMMCStack::DBody::RestoreInactivityTimeout()
50 iStack.iSocket->ResetInactivity(0);
52 if (--iInactivityLock == 0)
54 iStack.iSocket->iVcc->iInactivityTimeout = iInactivityTimeout;
55 if (iStack.iSocket->iVccCore)
56 iStack.iSocket->iVccCore->iInactivityTimeout = iVccCoreSleepTimeout;