Skip to content

Commit

Permalink
Merge pull request #191 from mcci-catena/issue190
Browse files Browse the repository at this point in the history
Fix USB-based hot-interrupt hang
  • Loading branch information
terrillmoore authored Mar 18, 2022
2 parents d5aac85 + 02274ae commit 9375c3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/// \ref _mcci_arduino_version_calc() to compare relative versions.
///
#define _mcci_arduino_version \
_mcci_arduino_version_calc(3, 0, 5, 1) /* v3.0.5-pre1 */
_mcci_arduino_version_calc(3, 0, 5, 2) /* v3.0.5-pre2 */

///
/// \brief get major version code from semantic version value
Expand Down
7 changes: 4 additions & 3 deletions system/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd)
hpcd->Instance->BTABLE = BTABLE_ADDRESS;

/*set wInterrupt_Mask global variable*/
wInterrupt_Mask = USB_CNTR_CTRM | USB_CNTR_WKUPM | USB_CNTR_SUSPM | USB_CNTR_ERRM \
wInterrupt_Mask = USB_CNTR_CTRM | USB_CNTR_WKUPM | USB_CNTR_SUSPM /* | USB_CNTR_ERRM */ \
| USB_CNTR_SOFM | USB_CNTR_ESOFM | USB_CNTR_RESETM;

/*Set interrupt mask*/
Expand Down Expand Up @@ -353,7 +353,8 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)

if (__HAL_PCD_GET_FLAG (hpcd, USB_ISTR_ERR))
{
__HAL_PCD_CLEAR_FLAG(hpcd, USB_ISTR_ERR);
__HAL_PCD_CLEAR_FLAG(hpcd, USB_ISTR_ERR);
hpcd->Instance->CNTR &= ~USB_ISTR_ERR;
}

if (__HAL_PCD_GET_FLAG (hpcd, USB_ISTR_WKUP))
Expand All @@ -362,7 +363,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)
hpcd->Instance->CNTR &= (uint16_t) ~(USB_CNTR_LPMODE);

/*set wInterrupt_Mask global variable*/
wInterrupt_Mask = USB_CNTR_CTRM | USB_CNTR_WKUPM | USB_CNTR_SUSPM | USB_CNTR_ERRM \
wInterrupt_Mask = USB_CNTR_CTRM | USB_CNTR_WKUPM | USB_CNTR_SUSPM /* | USB_CNTR_ERRM */ \
| USB_CNTR_SOFM | USB_CNTR_ESOFM | USB_CNTR_RESETM;

/*Set interrupt mask*/
Expand Down

0 comments on commit 9375c3a

Please sign in to comment.