void UART_printf(uint32_t baseAddress, const char *format,...) { uint32_t length; va_list args; uint32_t i; char TxBuffer[128] = {0}; va_start(args, format); length = vsnprintf((char*)TxBuffer, sizeof(TxBuffer), (char*)format, args); va_end(args); for(i = 0; i < length; i++) { while(UARTBusy(baseAddress)); UARTCharPut(baseAddress,TxBuffer[i]); } }
![](/resized-image/__size/640x480/__key/communityserver-discussions-components-files/96/7b6d60b5081e641ccd469a5c476ad4c.png)