19 bool USBHub::bResetInitiated =
false;
80 rcode = pUsb->
getDevDescr( 0, 0, 8, (uint8_t*)buf );
85 len = (buf[0] > 32) ? 32 : buf[0];
109 rcode = pUsb->
setAddr( 0, 0, bAddress );
126 rcode = pUsb->
getDevDescr( bAddress, 0, len, (uint8_t*)buf );
129 goto FailGetDevDescr;
135 goto FailSetDevTblEntry;
144 goto FailGetHubDescr;
158 rcode = pUsb->
getConfDescr(bAddress, 0, cd_len, 0, buf);
161 goto FailGetConfDescr;
168 rcode = pUsb->
getConfDescr(bAddress, 0, buf[0], 0, buf2);
171 goto FailGetConfDescr;
175 rcode = pUsb->
setConf(bAddress, 0, buf[5]);
178 goto FailSetConfDescr;
184 for (uint8_t j=1; j<=bNbrPorts; j++)
220 if (bAddress == 0x41)
237 if (qNextPollTime <= millis())
239 rcode = CheckHubStatus();
240 qNextPollTime = millis() + 100;
245 uint8_t USBHub::CheckHubStatus()
251 rcode = pUsb->
inTransfer(bAddress, 1, &read, buf);
267 for (uint8_t port=1,mask=0x02; port<8; mask<<=1, port++)
279 rcode = PortStatusChange(port, evt);
289 for (uint8_t port=1; port<=bNbrPorts; port++)
305 rcode = PortStatusChange(port, evt);
316 uint8_t USBHub::PortStatusChange(uint8_t port,
HubEvent &evt)
329 bResetInitiated =
true;
336 bResetInitiated =
false;
356 bResetInitiated =
false;
372 Serial.println(
"ERROR!");
375 Serial.print(
"\r\nPort ");
376 Serial.println(port, DEC);
378 Serial.println(
"Status");
379 Serial.print(
"CONNECTION:\t");
381 Serial.print(
"ENABLE:\t\t");
383 Serial.print(
"SUSPEND:\t");
385 Serial.print(
"OVER_CURRENT:\t");
387 Serial.print(
"RESET:\t\t");
389 Serial.print(
"POWER:\t\t");
391 Serial.print(
"LOW_SPEED:\t");
393 Serial.print(
"HIGH_SPEED:\t");
395 Serial.print(
"TEST:\t\t");
397 Serial.print(
"INDICATOR:\t");
403 Serial.println(
"\nChange");
404 Serial.print(
"CONNECTION:\t");
406 Serial.print(
"ENABLE:\t\t");
408 Serial.print(
"SUSPEND:\t");
410 Serial.print(
"OVER_CURRENT:\t");
412 Serial.print(
"RESET:\t\t");