[mw_shl_code=c,true]int main(void)
{
u8 len,t,res;
char temp[6];
SystemInit();
delay_init(72);
LED_Init(); ?
uart_init(9600);
L298N_Init();
LED_Init();
while(1)
{
if(USART_RX_STA&0x80)
{
len=USART_RX_STA&0x3f;
// printf("\r\n?ú·???????????:\r\n");
for(t=0;t<len;t++)
{
USART1->DR=USART_RX_BUF[t];
temp[t]=USART1->DR;
while((USART1->SR&0X40)==0);
}
//res=(temp[0]-0)*100+(temp[1]-'0')*10+temp[2]-'0';
// printf("%d",res);
//printf("\n\n"); //??????
USART_RX_STA=0;
}
}[/mw_shl_code]
[mw_shl_code=c,true]这是在MINI 开发板例子主函数里改动的,我没有用printf() 函数打开串口发送数据 怎么也能打印啊? 而且点击Hex发送完全没有反应,这是什么原因啊?
[/mw_shl_code]
|