// initDCD initializes and assigns a free device controller instance to the
// given USB port. Returns the initialized device controller or nil if no free
// device controller instances remain.
initDCD initializes and assigns a free device controller instance to the
given USB port. Returns the initialized device controller or nil if no free
device controller instances remain.
// initDCD initializes and assigns a free device controller instance to the // given USB port . Returns the initialized device controller or nil if no free // device controller instances remain .
func initDCD(port int, class class) (*dcd, status) {
	if 0 == dcdCount {
		return nil, statusInvalid 
	}
	switch class.id {
	case classDeviceCDCACM:
		if 0 == class.config || class.config > descCDCACMCount {
			return nil, statusInvalid 
		}
	default:
	}
	for i := range dcdInstance {
		if nil == dcdInstance[i].core {
			dcdInstance[i].dhw = allocDHW(port, i, &dcdInstance[i])
			dcdInstance[i].core = &coreInstance[port]
			dcdInstance[i].port = port
			dcdInstance[i].cc = class
			dcdInstance[i].id = i
			return &dcdInstance[i], statusOK
		}
	}
	return nil, statusBusy 
}
func initDCD ( port int , class class ) ( * dcd , status ) { if 0 == dcdCount { return nil , statusInvalid } switch class . id { case classDeviceCDCACM : if 0 == class . config || class . config > descCDCACMCount { return nil , statusInvalid } default : } for i := range dcdInstance { if nil == dcdInstance [ i ] . core { dcdInstance [ i ] . dhw = allocDHW ( port , i , & dcdInstance [ i ] ) dcdInstance [ i ] . core = & coreInstance [ port ] dcdInstance [ i ] . port = port dcdInstance [ i ] . cc = class dcdInstance [ i ] . id = i return & dcdInstance [ i ] , statusOK } } return nil , statusBusy }
initDCD initializes and assigns a free device controller instance to the
given USB port.
initDCD initializes and assigns a free device controller instance to the given USB port .
// Must have defined device controllers // Must have defined descriptors // Return the first instance whose assigned core is currently nil. // Initialize device controller. // No free device controller instances available.