Skip to content

Commit

Permalink
added HAL_UART_Receive_IT in main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz-Juranek committed Nov 8, 2017
1 parent 73eb49f commit 3f65a88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ int main(void)
canRxFlags.flags.fifo1 = 0;
HAL_CAN_Receive_IT(&hcan, CAN_FIFO0);
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
if (hUsbDeviceFS.dev_state != USBD_STATE_CONFIGURED) // to avoid rx buffer corrupiton due to UART noise
// reception only enabled when USB is disconnected
HAL_UART_Receive_IT(&huart2, &Uart2RxFifo, UART_RX_FIFO_SIZE);
}
/* USER CODE END WHILE */

Expand Down

0 comments on commit 3f65a88

Please sign in to comment.