Skip to content

Commit

Permalink
reapplied NAK fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pingdynasty committed Mar 31, 2020
1 parent 380331e commit d4336c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Magus/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd)
HAL_HCD_SOF_Callback(hhcd);
#endif /* USE_HAL_HCD_REGISTER_CALLBACKS */

// Added hack to re-enable the NAK interrupt because leaving it off is bad
for (i = 0U; i < hhcd->Init.Host_channels; i++)
{
USBx_HC(i)->HCINTMSK |= USB_OTG_HCINT_NAK;
}

__HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_SOF);
}

Expand Down Expand Up @@ -1342,6 +1348,8 @@ static void HCD_HC_IN_IRQHandler(HCD_HandleTypeDef *hhcd, uint8_t chnum)
/* ... */
}
__HAL_HCD_CLEAR_HC_INT(ch_num, USB_OTG_HCINT_NAK);
// Added hack to disable the NAK interrupt completely (it'll be re-enabled in SOF)
USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINT_NAK;
}
else
{
Expand Down

0 comments on commit d4336c8

Please sign in to comment.