/**
******************************************************************************
** \brief Re-target putchar function
******************************************************************************/
int fputc(int ch, FILE *f)
{
if (((uint8_t)ch) == '\n')
{
Debug_Output('\r');
}
Debug_Output(ch);
return ch;
}
void Debug_Output(uint8_t u8Data)
{
Uart_SendDataPoll(M0P_UART0,u8Data);
//M0P_UART0->SCON_f.REN = 0;
//M0P_UART0->SBUF = u8Data;
//
//while (TRUE != M0P_UART0->ISR_f.TI)
//{
// ;
//}
//M0P_UART0->ICR_f.TICLR = 0;
}
在DDL.H文件添加就可以了 重定义printf
小华半导体代理技术热线 131 6807 9092
|