kerneltest/e32test/device/t_usb.cpp
changeset 253 d37db4dcc88d
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
252:0a40b8675b23 253:d37db4dcc88d
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 // Device-side part, to work against USBRFLCT running on the host.
    16 // Device-side part, to work against USBRFLCT running on the host.
    17 // 
    17 // 
    18 //
    18 //
    19 
    19 
    20 #include "t_usb.h"
    20 #include "t_usb.h"
       
    21 #include "OstTraceDefinitions.h"
       
    22 #ifdef OST_TRACE_COMPILER_IN_USE
       
    23 #include "t_usbTraces.h"
       
    24 #endif
    21 
    25 
    22 
    26 
    23 void RunAppL(TBool aVerboseOutput)
    27 void RunAppL(TBool aVerboseOutput)
    24 	{
    28 	{
    25 	RDebug::Print(_L("RunAppL()"));
    29 	OstTrace0(TRACE_NORMAL, RUNAPPL_RUNAPPL, "RunAppL()");
    26 	// Construct the active scheduler
    30 	// Construct the active scheduler
    27 	CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
    31 	CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
    28 
    32 
    29 	// Push active scheduler onto the cleanup stack
    33 	// Push active scheduler onto the cleanup stack
    30 	CleanupStack::PushL(myScheduler);
    34 	CleanupStack::PushL(myScheduler);
    54 	}
    58 	}
    55 
    59 
    56 
    60 
    57 TInt E32Main()
    61 TInt E32Main()
    58 	{
    62 	{
    59 	RDebug::Print(_L("E32Main()"));
    63 	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "E32Main()");
    60 
    64 
    61 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
    65 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
    62 
    66 
    63 	__UHEAP_MARK;
    67 	__UHEAP_MARK;
    64 
    68 
    66 	TBuf<64> c;
    70 	TBuf<64> c;
    67 	User::CommandLine(c);
    71 	User::CommandLine(c);
    68 	TBool verbose = EFalse;
    72 	TBool verbose = EFalse;
    69 	if (c.CompareF(KArg) == 0)
    73 	if (c.CompareF(KArg) == 0)
    70 		{
    74 		{
    71 		RDebug::Print(_L("(Verbose output enabled.)\n"));
    75 		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "(Verbose output enabled.)\n");
    72 		verbose = ETrue;
    76 		verbose = ETrue;
    73 		}
    77 		}
    74 
    78 
    75 	TRAPD(error, RunAppL(verbose));
    79 	TRAPD(error, RunAppL(verbose));
    76 
    80 
    78 
    82 
    79 	__UHEAP_MARKEND;
    83 	__UHEAP_MARKEND;
    80 
    84 
    81 	delete cleanup;											// destroy clean-up stack
    85 	delete cleanup;											// destroy clean-up stack
    82 
    86 
    83 	RDebug::Print(_L("Program exit: done.\n"));
    87 	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "Program exit: done.\n");
    84 
    88 
    85 	return 0;												// and return
    89 	return 0;												// and return
    86 	}
    90 	}
    87 
    91 
    88 
    92