- void *hdl2;
-
- hdl = Host->HostDef->SendIN(Host->Ptr, dest, 0, NULL, NULL, Data, Len);
-
- hdl2 = Host->HostDef->SendOUT(Host->Ptr, dest, 0, NULL, NULL, NULL, 0);
- while( Host->HostDef->IsOpComplete(Host->Ptr, hdl2) == 0 )
- Time_Delay(1);
+ if( Type & 0x80 )
+ {
+ LOG("IN");
+ hdl = Host->HostDef->ControlIN(Host->Ptr, dest, 1, NULL, NULL, Data, Len);
+
+ LOG("OUT (Status)");
+ hdl = Host->HostDef->ControlOUT(Host->Ptr, dest, 1, USB_int_WakeThread, thisthread, NULL, 0);
+ }
+ else
+ {
+ LOG("OUT");
+ Host->HostDef->ControlOUT(Host->Ptr, dest, 1, NULL, NULL, Data, Len);
+
+ // Status phase (DataToggle=1)
+ LOG("IN (Status)");
+ hdl = Host->HostDef->ControlIN(Host->Ptr, dest, 1, USB_int_WakeThread, thisthread, NULL, 0);
+ }