Update contrib.
1 // Copyright (c) 1994-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 // template\template_variant\specific\monitor.cpp
15 // Kernel crash debugger - Template specific
19 #include <kernel/monitor.h>
25 void CrashDebugger::InitUart()
27 // Wait for last kernel trace to appear
28 TTemplate::BootWaitMilliSeconds(100);
33 // Initialise the UART for outputing debug strings. Need to work with the following settings:
35 // - 8 data bits, 1 stop bit
37 // Obtain and use UART linear base address to access the UART registers, e.g.
38 // TUint32 debugPortBase = TTemplate::DebugPortAddr();
42 void CrashDebugger::UartOut(TUint aChar)
47 // Output aChar through debug UART
48 // Obtain and use UART linear base address to access the UART register, e.g.
49 // Should take in consideration software flow control and check if Power is stable as per example below (pseudo-code):
52 // TUint32 debugPortBase = TTemplate::DebugPortAddr(); TO DO: (mandatory): Uncomment this
53 // while (!(input FIFO empty)) TO DO: (mandatory): Implement
57 // c=(read received char); TO DO: (mandatory): Implement
63 // while((input FIFO empty)) TO DO: (mandatory): Implement
68 // c=(read received char); TO DO: (mandatory): Implement
71 else if (c==3) // Ctrl C
76 // coverity[dead_error_condition]
77 // The next line should be reachable when this template file is edited for use
78 else if (c==3) // Ctrl C
82 // while ((output FIFO full)) TO DO: (mandatory): wait for last char to leave the FIFO (Implement)
84 // (write aChar to output port - or FIFO); TO DO: (mandatory): Implement
87 TUint8 CrashDebugger::UartIn()
92 // Wait for a char to arrive at input port, read it and return its value
93 // Use the UART linear base address obtained as in below example to access the UART registers
94 // Example below is pseudo-code:
96 // TUint32 debugPortBase = TTemplate::DebugPortAddr(); TO DO: (mandatory): Uncomment this
97 // while ((input FIFO empty)) TO DO: (mandatory): wait for a character to arrive (Implement)
102 // return (read received char); TO DO: (mandatory): Implement
103 return 0; // EXAMPLE ONLY
106 TBool CrashDebugger::CheckPower()
109 // TO DO: (mandatory)
111 // Check if power supply is stable and return ETrue if not
113 return EFalse; // EXAMPLE ONLY