@@ -123,7 +123,7 @@ uint32_t USBHost::SetPipeAddress(uint32_t addr, uint32_t ep, EpInfo **ppep, uint
123
123
/* 01-0f = non-zero HRSLT */
124
124
uint32_t USBHost::ctrlReq (uint32_t addr, uint32_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi,
125
125
uint16_t wInd, uint16_t total, uint32_t nbytes, uint8_t * dataptr, USBReadParser *p) {
126
-
126
+
127
127
uint32_t direction = 0 ; // Request direction, IN or OUT
128
128
uint32_t rcode;
129
129
SETUP_PKT setup_pkt;
@@ -194,14 +194,14 @@ uint32_t USBHost::ctrlReq(uint32_t addr, uint32_t ep, uint8_t bmReqType, uint8_t
194
194
((USBReadParser*)p)->Parse (read, dataptr, total - left);
195
195
}
196
196
else // OUT transfer
197
- {
197
+ {
198
198
pep->bmSndToggle = 1 ; // bmSNDTOG1;
199
199
rcode = OutTransfer (pep, nak_limit, nbytes, dataptr);
200
200
}
201
201
if (rcode) // return error
202
202
return (rcode);
203
203
}
204
-
204
+
205
205
// Status stage
206
206
UHD_Pipe_CountZero (pep->epAddr );
207
207
USB->HOST .HostPipe [pep->epAddr ].PSTATUSSET .reg = USB_HOST_PSTATUSSET_DTGL;
@@ -268,11 +268,11 @@ uint32_t USBHost::InTransfer(EpInfo *pep, uint32_t nak_limit, uint8_t *nbytesptr
268
268
}
269
269
/* check for RCVDAVIRQ and generate error if not present */
270
270
/* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */
271
-
271
+
272
272
pktsize = uhd_byte_count (pep->epAddr ); // Number of received bytes
273
-
273
+
274
274
USB->HOST .HostPipe [pep->epAddr ].PSTATUSCLR .reg = USB_HOST_PSTATUSCLR_BK0RDY;
275
-
275
+
276
276
// printf("Got %i bytes \r\n", pktsize);
277
277
// This would be OK, but...
278
278
// assert(pktsize <= nbytes);
@@ -297,7 +297,7 @@ uint32_t USBHost::InTransfer(EpInfo *pep, uint32_t nak_limit, uint8_t *nbytesptr
297
297
/* 1. The device sent a short packet (L.T. maxPacketSize) */
298
298
/* 2. 'nbytes' have been transferred. */
299
299
if ((pktsize < maxpktsize) || (*nbytesptr >= nbytes)) // have we transferred 'nbytes' bytes?
300
- {
300
+ {
301
301
// Save toggle value
302
302
pep->bmRcvToggle = USB_HOST_DTGL (pep->epAddr );
303
303
// printf("\r\n");
@@ -505,7 +505,7 @@ void USBHost::Task(void) //USB state machine
505
505
TRACE_USBHOST (printf (" + USB_DETACHED_SUBSTATE_INITIALIZE\r\n " );)
506
506
507
507
// Init USB stack and driver
508
- UHD_Init ();
508
+ Init ();
509
509
510
510
// Free all USB resources
511
511
for (uint32_t i = 0 ; i < USB_NUMDEVICES; ++i)
0 commit comments