19 bool USBHub::bResetInitiated =
false;
42 uint8_t
USBHub::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
83 len = (buf[0] > 32) ? 32 : buf[0];
106 rcode = pUsb->
setAddr(0, 0, bAddress);
122 rcode = pUsb->
getDevDescr(bAddress, 0, len, (uint8_t*)buf);
125 goto FailGetDevDescr;
131 goto FailSetDevTblEntry;
140 goto FailGetHubDescr;
153 rcode = pUsb->
getConfDescr(bAddress, 0, cd_len, 0, buf);
156 goto FailGetConfDescr;
163 rcode = pUsb->
getConfDescr(bAddress, 0, buf[0], 0, buf2);
166 goto FailGetConfDescr;
170 rcode = pUsb->
setConf(bAddress, 0, buf[5]);
173 goto FailSetConfDescr;
179 for (uint8_t j = 1; j <= bNbrPorts; j++)
214 if (bAddress == 0x41)
230 if (qNextPollTime <= millis()) {
231 rcode = CheckHubStatus();
232 qNextPollTime = millis() + 100;
237 uint8_t USBHub::CheckHubStatus() {
242 rcode = pUsb->
inTransfer(bAddress, 1, &read, buf);
258 for (uint8_t port = 1, mask = 0x02; port < 8; mask <<= 1, port++) {
268 rcode = PortStatusChange(port, evt);
278 for (uint8_t port = 1; port <= bNbrPorts; port++) {
293 rcode = PortStatusChange(port, evt);
314 for (
int i = 0; i < 3; i++) {
327 uint8_t USBHub::PortStatusChange(uint8_t port,
HubEvent &evt) {
338 bResetInitiated =
true;
345 bResetInitiated =
false;
365 bResetInitiated =
false;