2019-10-07 02:01 AM
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) // call back function
{
static unsigned int i = 0;
HAL_UART_Receive_IT(&huart1,(uint8_t*)&rx[i],1);
i++;
if(i==200)
{
f.g_gps_data_received_F=1;
__HAL_UART_DISABLE_IT(&huart1, UART_IT_RXNE);
i=0;
}
}
2019-10-07 06:02 AM
Not a big fan of the HAL USART implementation. Waiting for 200 characters before flagging probably not going to do the job here.
You're probably going to want to use ring buffer for the input/output. And then process the responses to each of the AT command as you send them. Usually scoped with a <CR><LF>, with responses like OK, ERROR, NO CARRIER, etc