mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
core: check whether USB structures are correct to avoid faults in shutdown
This commit is contained in:
parent
9d461f548e
commit
0064fda203
@ -214,7 +214,9 @@ uint64_t sdcard_get_capacity_in_bytes(void) {
|
||||
|
||||
void SDIO_IRQHandler(void) {
|
||||
IRQ_ENTER(SDIO_IRQn);
|
||||
HAL_SD_IRQHandler(&sd_handle);
|
||||
if (sd_handle.Instance) {
|
||||
HAL_SD_IRQHandler(&sd_handle);
|
||||
}
|
||||
IRQ_EXIT(SDIO_IRQn);
|
||||
}
|
||||
|
||||
|
@ -706,12 +706,20 @@ void USBD_LL_Delay(uint32_t Delay)
|
||||
*/
|
||||
#if defined(USE_USB_FS)
|
||||
void OTG_FS_IRQHandler(void) {
|
||||
HAL_PCD_IRQHandler(&pcd_fs_handle);
|
||||
IRQ_ENTER(OTG_FS_IRQn);
|
||||
if (pcd_fs_handle.Instance) {
|
||||
HAL_PCD_IRQHandler(&pcd_fs_handle);
|
||||
}
|
||||
IRQ_EXIT(OTG_FS_IRQn);
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_USB_HS)
|
||||
void OTG_HS_IRQHandler(void) {
|
||||
HAL_PCD_IRQHandler(&pcd_hs_handle);
|
||||
IRQ_ENTER(OTG_HS_IRQn);
|
||||
if (pcd_hs_handle.Instance) {
|
||||
HAL_PCD_IRQHandler(&pcd_hs_handle);
|
||||
}
|
||||
IRQ_EXIT(OTG_HS_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -760,18 +768,24 @@ static void OTG_CMD_WKUP_Handler(PCD_HandleTypeDef *pcd_handle) {
|
||||
*/
|
||||
#if defined(USE_USB_FS)
|
||||
void OTG_FS_WKUP_IRQHandler(void) {
|
||||
OTG_CMD_WKUP_Handler(&pcd_fs_handle);
|
||||
|
||||
IRQ_ENTER(OTG_FS_WKUP_IRQn);
|
||||
if (pcd_fs_handle.Instance) {
|
||||
OTG_CMD_WKUP_Handler(&pcd_fs_handle);
|
||||
}
|
||||
/* Clear EXTI pending Bit*/
|
||||
__HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG();
|
||||
IRQ_EXIT(OTG_FS_WKUP_IRQn);
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_USB_HS)
|
||||
void OTG_HS_WKUP_IRQHandler(void) {
|
||||
OTG_CMD_WKUP_Handler(&pcd_hs_handle);
|
||||
|
||||
IRQ_ENTER(OTG_HS_WKUP_IRQn);
|
||||
if (pcd_hs_handle.Instance) {
|
||||
OTG_CMD_WKUP_Handler(&pcd_hs_handle);
|
||||
}
|
||||
/* Clear EXTI pending Bit*/
|
||||
__HAL_USB_HS_EXTI_CLEAR_FLAG();
|
||||
IRQ_EXIT(OTG_HS_WKUP_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user