Update contrib.
1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test/usb\t_usb_device\src\activetimer.cpp
15 // USB Test Program T_USB_DEVICE, functional part.
16 // Device-side part, to work against T_USB_HOST running on the host.
20 #include "general.h" // CActiveControl, CActiveRW
21 #include "activetimer.h"
24 extern TBool gVerbose;
26 extern TBool gStopOnFail;
27 extern TInt gSoakCount;
30 // --- class CActiveTimer ---------------------------------------------------------
33 CActiveTimer::CActiveTimer(CConsoleBase* aConsole, RDEVCLIENT* aPort)
34 : CActive(EPriorityNormal),
38 CActiveScheduler::Add(this);
42 CActiveTimer* CActiveTimer::NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort)
44 CActiveTimer* self = new (ELeave) CActiveTimer(aConsole, aPort);
45 CleanupStack::PushL(self);
47 CleanupStack::Pop(); // self
52 void CActiveTimer::ConstructL()
54 User::LeaveIfError(iTimer.CreateLocal());
58 CActiveTimer::~CActiveTimer()
60 TUSB_VERBOSE_PRINT("CActiveTimer::~CActiveTimer()");
61 Cancel(); // base class
66 void CActiveTimer::DoCancel()
68 TUSB_VERBOSE_PRINT("CActiveTimer::DoCancel()");
73 void CActiveTimer::RunL()
75 TUSB_VERBOSE_PRINT("CActiveTimer::RunL()");
76 // Nothing to do here, as we call ReadCancel() after a manual WaitForRequest()
77 // (in CActiveRW::ReceiveVersion()).
81 void CActiveTimer::Activate(TTimeIntervalMicroSeconds32 aDelay)
83 __ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
84 iTimer.After(iStatus, aDelay);