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]); } }