19 bool USBHub::bResetInitiated =
false;
42 uint8_t
USBHub::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
82 len = (buf[0] > 32) ? 32 : buf[0];
105 rcode = pUsb->
setAddr(0, 0, bAddress);
121 rcode = pUsb->
getDevDescr(bAddress, 0, len, (uint8_t*)buf);
124 goto FailGetDevDescr;
130 goto FailSetDevTblEntry;
139 goto FailGetHubDescr;
152 rcode = pUsb->
getConfDescr(bAddress, 0, cd_len, 0, buf);
155 goto FailGetConfDescr;
162 rcode = pUsb->
getConfDescr(bAddress, 0, buf[0], 0, buf2);
165 goto FailGetConfDescr;
169 rcode = pUsb->
setConf(bAddress, 0, buf[5]);
172 goto FailSetConfDescr;
178 for (uint8_t j = 1; j <= bNbrPorts; j++)
211 if (bAddress == 0x41)
227 if (qNextPollTime <= millis()) {
228 rcode = CheckHubStatus();
229 qNextPollTime = millis() + 100;
234 uint8_t USBHub::CheckHubStatus() {
239 rcode = pUsb->
inTransfer(bAddress, 1, &read, buf);
255 for (uint8_t port = 1, mask = 0x02; port < 8; mask <<= 1, port++) {
265 rcode = PortStatusChange(port, evt);
275 for (uint8_t port = 1; port <= bNbrPorts; port++) {
290 rcode = PortStatusChange(port, evt);
301 uint8_t USBHub::PortStatusChange(uint8_t port,
HubEvent &evt) {
312 bResetInitiated =
true;
319 bResetInitiated =
false;
339 bResetInitiated =
false;