Parcourir la source

fix bug with enum task skipping decriptor

hathach il y a 13 ans
Parent
commit
0b08dc7724
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      tinyusb/host/usbh.c

+ 2 - 2
tinyusb/host/usbh.c

@@ -408,7 +408,7 @@ OSAL_TASK_DECLARE(usbh_enumeration_task)
         // TODO check class_open_subtask status
         // TODO check class_open_subtask status
         if (length == 0) // Interface open failed, for example a subclass is not supported
         if (length == 0) // Interface open failed, for example a subclass is not supported
         {
         {
-          p_desc += p_desc[DESCRIPTOR_OFFSET_TYPE]; // skip this interface, the rest will be skipped by the above loop
+          p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // skip this interface, the rest will be skipped by the above loop
           // TODO can optimize the length --> open_subtask return a OPEN FAILED status
           // TODO can optimize the length --> open_subtask return a OPEN FAILED status
         }else
         }else
         {
         {
@@ -417,7 +417,7 @@ OSAL_TASK_DECLARE(usbh_enumeration_task)
         }
         }
       } else // unsupported class (not enable or yet implemented)
       } else // unsupported class (not enable or yet implemented)
       {
       {
-        p_desc += p_desc[DESCRIPTOR_OFFSET_TYPE]; // skip this interface, the rest will be skipped by the above loop
+        p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // skip this interface, the rest will be skipped by the above loop
       }
       }
     }
     }
   }
   }