在给stm32f407的板子下测试程序后,串口为什么有时显示:Device In suspend mode.
这段文字只有在这里的代码有
void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd)
{
g_device_state = 0;
printf("Device In suspend mode.\r\n");
USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData);
__HAL_PCD_GATE_PHYCLOCK(hpcd);
if (hpcd->Init.low_power_enable)
{
/* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */
SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk));
}
}