askari.nima

Hal Usart Suggestions 

Discussion created by askari.nima on Dec 5, 2017

I think its very useful if put Hal_GetTick() on usart rx interrupt

 

static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart)
{
   uint16_t* tmp;
   /* Check that a Rx process is ongoing */
   if(huart->RxState == HAL_UART_STATE_BUSY_RX)
   {
      huart->LastTimeRecevied = HAL_GetTick();
      if(huart->Init.WordLength == UART_WORDLENGTH_9B)
      .

      .

      .

      . 

Outcomes