Fix USB priority preventing CAN TX from timing out

The blocking CAN implementation relies on SysTick for its timeout. USB had a higher priority than Systick, so the TX never timed out, causing the serial port to hang indefinitely.
This commit is contained in:
Jared Sanson 2018-10-28 15:25:37 -07:00
parent 8b2ae813fe
commit e2610ad57d
1 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,8 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
__HAL_RCC_USB_CLK_ENABLE();
/* Peripheral interrupt init */
HAL_NVIC_SetPriority(USB_IRQn, 0, 0);
// IMPORTANT: USB must have a lower priority than SysTick, or timeouts won't work
HAL_NVIC_SetPriority(USB_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(USB_IRQn);
/* USER CODE BEGIN USB_MspInit 1 */