Merge branch 'master' of https://github.com/hathach/tinyusb into dwc2_dma

This commit is contained in:
HiFiPhile
2024-06-27 20:49:40 +02:00
452 changed files with 19713 additions and 7128 deletions

View File

@@ -1297,4 +1297,25 @@ void dcd_int_handler(uint8_t rhport) {
// }
}
#if defined(TUP_USBIP_DWC2_TEST_MODE) && CFG_TUD_TEST_MODE
bool dcd_check_test_mode_support(test_mode_t test_selector) {
// Check if test mode selector is unsupported
if (TEST_FORCE_ENABLE < test_selector || TEST_J > test_selector) {
return false;
}
return true;
}
void dcd_enter_test_mode(uint8_t rhport, test_mode_t test_selector) {
// Get port address...
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
// Enable the test mode
dwc2->dctl = (dwc2->dctl & ~DCTL_TCTL_Msk) | (test_selector << DCTL_TCTL_Pos);
}
#endif /* TUP_USBIP_DWC2_TEST_MODE && CFG_TUD_TEST_MODE */
#endif