113 void InitEntry(uint8_t index) {
117 thePool[index].
epinfo = &dev0ep;
122 uint8_t FindAddressIndex(uint8_t address = 0) {
123 for(uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++) {
124 if(thePool[i].address.devAddress == address)
133 for(uint8_t i = (start < 1 || start >= MAX_DEVICES_ALLOWED) ? 1 : start; i < MAX_DEVICES_ALLOWED; i++) {
134 if(thePool[i].address.bmParent == addr.
bmAddress)
142 void FreeAddressByIndex(uint8_t index) {
150 for(uint8_t i = 1; (i = FindChildIndex(uda, i));)
151 FreeAddressByIndex(i);
162 void InitAllAddresses() {
163 for(uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++)
176 thePool[0].
epinfo = &dev0ep;
192 uint8_t index = FindAddressIndex(addr);
194 return (!index) ? NULL : thePool + index;
203 for(uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++)
204 if(thePool[i].address.devAddress)
210 virtual uint8_t
AllocAddress(uint8_t parent,
bool is_hub =
false, uint8_t port = 0) {
219 if(is_hub && hubCounter == 7)
223 uint8_t index = FindAddressIndex(0);
268 uint8_t index = FindAddressIndex(addr);
269 FreeAddressByIndex(index);