Guest User

Untitled

a guest
Jan 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.22 KB | None | 0 0
  1.         // run transactions
  2.         for(dlelement_t* elem = transfer->transactions->head; elem != 0; elem = elem->next)
  3.         {
  4.           #ifdef _UHCI_DIAGNOSIS_
  5.             uint16_t num = inportw(u->bar + UHCI_FRNUM);
  6.             printf("\nFRBADDR: %X  frame pointer: %X frame number: %u", inportl(u->bar + UHCI_FRBASEADD), u->framelistAddrVirt->frPtr[num], num);
  7.           #endif
  8.  
  9.             timeout = 100; // Wait up to 100 ms
  10.             while(timeout > 0)
  11.             {
  12.                 bool b = true;
  13.                 for(dlelement_t* elem = transfer->transactions->head; b && elem; elem = elem->next)
  14.                 {
  15.                     uhci_transaction_t* uT = ((usb_transaction_t*)elem->data)->data;
  16.                     b = b && !uT->TD->active;
  17.                 }
  18.                 if(b)
  19.                     break;
  20.                 sleepMilliSeconds(10);
  21.                 timeout--;
  22.             }
  23.             if(timeout == 0)
  24.             {
  25.                 textColor(ERROR);
  26.                 printf("\nUHCI: Timeout during waiting for TD execution!");
  27.                 textColor(TEXT);
  28.             }
  29.  
  30.             delay(50000); // pause after transaction
  31.         }
  32.         delay(50000); // pause after transfer
Add Comment
Please, Sign In to add comment