Skip to content

Commit 73f1a49

Browse files
committed
stmhal: Exclude USB HS code when USB HS mode not enabled.
1 parent c92c7a6 commit 73f1a49

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

stmhal/usbd_conf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
9494
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
9595
}
9696

97+
#if defined(USE_USB_HS)
9798
else if(hpcd->Instance == USB_OTG_HS)
9899
{
99100
/* Configure USB FS GPIOs */
@@ -158,6 +159,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
158159
/* Enable USBHS Interrupt */
159160
HAL_NVIC_EnableIRQ(OTG_HS_IRQn);
160161
}
162+
#endif
161163
}
162164
/**
163165
* @brief DeInitializes the PCD MSP.
@@ -172,12 +174,14 @@ void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd)
172174
__USB_OTG_FS_CLK_DISABLE();
173175
__SYSCFG_CLK_DISABLE();
174176
}
177+
#if defined(USE_USB_HS)
175178
else if(hpcd->Instance == USB_OTG_HS)
176179
{
177180
/* Disable USB FS Clocks */
178181
__USB_OTG_HS_CLK_DISABLE();
179182
__SYSCFG_CLK_DISABLE();
180183
}
184+
#endif
181185
}
182186

183187
/*******************************************************************************

0 commit comments

Comments
 (0)