void Usart_Printf(USART_DATA *uart_data_struct,char* fmt,...)
{
va_list ap;
va_start(ap,fmt);
vsprintf((char*)uart_data_struct->tx_buff,fmt,ap);
va_end(ap);
uart_data_struct->tx_length=strlen((const char*)uart_data_struct->tx_buff);//此次发送数据的长度
while(uart_data_struct->tx_busy);
uart_data_struct->tx_busy=1;
uart_data_struct->usart_n->DR = (uart_data_struct->tx_buff[0] & (uint16_t)0x01FF);
uart_data_struct->tx_numb=1;
}
if(Judge_Openmv_Response("OK"))
u8 Judge_Openmv_Response(char* fmt,...)
{
char p[30];
if(!rx_flag) return 0;
va_list ap;
va_start(ap,fmt);
vsprintf((char*)p,fmt,ap);
va_end(ap);
if(strstr((char*)openmv_rx_data,p)==NULL) return 0;
else return 1;
}
void Openmv_Send_Cmd(char* cmd)
{
Usart_Printf(&uart2,"%s\n",cmd);
}