/** @file\r
- Simple Console that sits on a SerialLib. \r
+ Simple Console that sits on a SerialLib.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
-/* \r
+/*\r
Symbols used in table below\r
===========================\r
ESC = 0x1B\r
\r
SIMPLE_TEXT_OUT_DEVICE_PATH mDevicePath = {\r
{\r
- { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, sizeof (VENDOR_DEVICE_PATH), 0},\r
+ { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH), 0} },\r
EFI_CALLER_ID_GUID\r
},\r
{\r
- { MESSAGING_DEVICE_PATH, MSG_UART_DP, sizeof (UART_DEVICE_PATH), 0},\r
+ { MESSAGING_DEVICE_PATH, MSG_UART_DP, { sizeof (UART_DEVICE_PATH), 0} },\r
0, // Reserved\r
FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate\r
FixedPcdGet8 (PcdUartDefaultDataBits), // DataBits\r
FixedPcdGet8 (PcdUartDefaultParity), // Parity (N)\r
FixedPcdGet8 (PcdUartDefaultStopBits) // StopBits\r
},\r
- { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, sizeof (EFI_DEVICE_PATH_PROTOCOL), 0}\r
+ { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_DEVICE_PATH_PROTOCOL), 0} }\r
};\r
\r
\r
)\r
{\r
CHAR8 Char;\r
- \r
+\r
if (!SerialPortPoll ()) {\r
return EFI_NOT_READY;\r
}\r
- \r
+\r
SerialPortRead ((UINT8 *)&Char, 1);\r
- \r
+\r
//\r
// Check for ESC sequence. This code is not techincally correct VT100 code.\r
// An illegal ESC sequence represents an ESC and the characters that follow.\r
- // This code will eat one or two chars after an escape. This is done to \r
+ // This code will eat one or two chars after an escape. This is done to\r
// prevent some complex FIFOing of the data. It is good enough to get\r
// the arrow and delete keys working\r
//\r
Key->ScanCode = SCAN_HOME;\r
break;\r
case 'K':\r
- case 'F': // PC ANSI \r
+ case 'F': // PC ANSI\r
Key->ScanCode = SCAN_END;\r
break;\r
case '@':\r
Key->ScanCode = SCAN_INSERT;\r
break;\r
case 'P':\r
- case 'X': // PC ANSI \r
+ case 'X': // PC ANSI\r
Key->ScanCode = SCAN_DELETE;\r
break;\r
case 'U':\r
}\r
}\r
} else if (Char < ' ') {\r
- if ((Char == CHAR_BACKSPACE) || \r
- (Char == CHAR_TAB) || \r
- (Char == CHAR_LINEFEED) || \r
+ if ((Char == CHAR_BACKSPACE) ||\r
+ (Char == CHAR_TAB) ||\r
+ (Char == CHAR_LINEFEED) ||\r
(Char == CHAR_CARRIAGE_RETURN)) {\r
// Only let through EFI required control characters\r
- Key->UnicodeChar = (CHAR16)Char; \r
+ Key->UnicodeChar = (CHAR16)Char;\r
}\r
} else if (Char == 0x7f) {\r
Key->ScanCode = SCAN_DELETE;\r
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
UINTN MaxColumn;\r
UINTN MaxRow;\r
- \r
+\r
Size = StrLen(String) + 1;\r
OutputString = AllocatePool(Size);\r
\r
//If there is any non-ascii characters in String buffer then replace it with '?'\r
//Eventually, UnicodeStrToAsciiStr API should be fixed.\r
- SafeUnicodeStrToAsciiStr(String, OutputString); \r
+ SafeUnicodeStrToAsciiStr(String, OutputString);\r
SerialPortWrite ((UINT8 *)OutputString, Size - 1);\r
\r
//\r
This,\r
Mode->Mode,\r
&MaxColumn,\r
- &MaxRow \r
+ &MaxRow\r
);\r
if (EFI_ERROR(Status)) {\r
return EFI_UNSUPPORTED;\r
&mSimpleTextIn.WaitForKey\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces(\r
&mInstallHandle,\r
&gEfiSimpleTextInProtocolGuid, &mSimpleTextIn,\r
gST->ConOut = &mSimpleTextOut;\r
gST->ConIn = &mSimpleTextIn;\r
}\r
- \r
+\r
return Status;\r
}\r