您好!
之前 用STM32时,使用PRINTF,很方便,tm4c如何实现printf("%d",A)?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
串口打印信息可以使用uartstdio.c中的UARTprintf即可,默认的是串口0.
如果想要使用其他串口,修改uartstdio.c中的如下代码:
//*****************************************************************************
//
// The base address of the chosen UART.
//
//*****************************************************************************
static uint32_t g_ui32Base = 0;
把这个值改了就行。当然源码中要先初始化对应的串口UARTprintf,当然用printf也行,你需要重新自己定向printf函数
printf占用的系统资源太多,所以TM4中使用的是
http://blog.csdn.net/wdscq1234/article/details/7944036
可以参考这个,函数中的
int fputc(int ch, FILE *f) { USART_SendData(USART1, (uint8_t) ch); while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); return ch; }
关于串口的部分,代替为TM4中的串口函数即可。仅适用于MDK中,CCS不知道可不可以用。