IN UINTN NumberOfBytes\r
)\r
{\r
- UINTN Count;\r
+ UINT8* CONST Final = &Buffer[NumberOfBytes];\r
\r
- for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {\r
- while ((MmioRead32 (UartBase + UARTFR) & UART_TX_EMPTY_FLAG_MASK) == 0);\r
+ while (Buffer < Final) {\r
+ // Wait until UART able to accept another char\r
+ while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK));\r
+ \r
MmioWrite8 (UartBase + UARTDR, *Buffer);\r
}\r
\r