Change to control complete cb

This commit is contained in:
Rocky04
2024-01-15 15:10:46 +00:00
parent 1755bba509
commit c3e96e667f
3 changed files with 24 additions and 40 deletions

View File

@@ -1353,7 +1353,7 @@ void dcd_int_handler(uint8_t rhport)
#if defined(TUP_USBIP_DWC2_TEST_MODE_SUPPORT)
bool dcd_test_mode_supported(test_mode_t test_selector) {
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;
@@ -1363,15 +1363,10 @@ bool dcd_test_mode_supported(test_mode_t test_selector) {
}
void dcd_enter_test_mode(uint8_t rhport, test_mode_t test_selector) {
// Disable test mode if not supported
if (!dcd_test_mode_supported(test_selector)) {
// Disable test mode if not supported as a fall back
if (!dcd_check_test_mode_support(test_selector)) {
test_selector = 0;
}
// Delay the entering a bit so there is enough time to acknowledge request
uint32_t count = SystemCoreClock / 20000;
while (count--) __NOP();
// Get port address...
dwc2_regs_t* dwc2 = DWC2_REG(rhport);