void OTG_FS_WKUP_IRQHandler(void) { if(USB_OTG_dev.cfg.low_power) { *(uint32_t *)(0xE000ED10) &= 0xFFFFFFF9 ; SystemInit(); USB_OTG_UngateClock(&USB_OTG_dev); } EXTI_ClearITPendingBit(EXTI_Line18); }
/** * @brief This function handles EXTI15_10_IRQ Handler. * @param None * @retval None */ void OTG_FS_WKUP_IRQHandler (void) { if (USB_OTG_dev.cfg.low_power) { /* Reset SLEEPDEEP and SLEEPONEXIT bits */ SCB ->SCR &= (uint32_t) ~((uint32_t) (SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); /* After wake-up from sleep mode, reconfigure the system clock */ SystemInit (); USB_OTG_UngateClock (&USB_OTG_dev); } EXTI_ClearITPendingBit (EXTI_Line18); }
void OTG_FS_WKUP_IRQHandler(void) { if(USB_OTG_Core.cfg.low_power) { *(uint32_t *)(0xE000ED10) &= 0xFFFFFFF9 ; SystemInit(); #ifdef USE_DEVICE_MODE USB_OTG_UngateClock(&USB_OTG_Core); #endif } EXTI_ClearITPendingBit(EXTI_Line18); }
/** * @brief This function handles EXTI0_IRQ Handler. * @param None * @retval None */ void EXTI0_IRQHandler(void) { if (EXTI_GetITStatus(EXTI_Line0) != RESET) { // if (USB_OTG_dev.dev.DevRemoteWakeup) { if((USB_OTG_dev.cfg.low_power)&&(USB_OTG_dev.dev.device_status==USB_OTG_SUSPENDED)) { /* Reset SLEEPDEEP and SLEEPONEXIT bits */ SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); /* After wake-up from sleep mode, reconfigure the system clock */ /* After wake-up from STOP reconfigure the system clock */ /* Enable HSE */ RCC_HSEConfig(RCC_HSE_ON); /* Wait till HSE is ready */ while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET); /* Enable PLL */ RCC_PLLCmd(ENABLE); /* Wait till PLL is ready */ while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET); /* Select PLL as system clock source */ RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); /* Wait till PLL is used as system clock source */ while (RCC_GetSYSCLKSource() != 0x08); USB_OTG_UngateClock(&USB_OTG_dev); } USB_OTG_ActiveRemoteWakeup(&USB_OTG_dev); USB_OTG_dev.dev.device_status = USB_OTG_dev.dev.device_old_status; // } /* Clear the EXTI line pending bit */ EXTI_ClearITPendingBit(EXTI_Line0); } }
void OTG_HS_WKUP_IRQHandler(void) { if (remote_wakeup ==1) { remote_wakeup = 0; } else { if(USB_OTG_dev.cfg.low_power) { /* Reset SLEEPDEEP and SLEEPONEXIT bits */ SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); /* After wake-up from sleep mode, reconfigure the system clock */ RCC_HSEConfig(RCC_HSE_ON); /* Wait till HSE is ready */ while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET) {} /* Enable PLL */ RCC_PLLCmd(ENABLE); /* Wait till PLL is ready */ while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {} /* Select PLL as system clock source */ RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); /* Wait till PLL is used as system clock source */ while (RCC_GetSYSCLKSource() != 0x08) {} USB_OTG_UngateClock(&USB_OTG_dev); } } EXTI_ClearITPendingBit(EXTI_Line20); }