Skip to content

Commit 9fbb280

Browse files
ladyadadeanm1278
authored andcommitted
fix random init() call, set debug output to Serial1
1 parent ae24971 commit 9fbb280

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libraries/USBHost/src/Usb.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ uint32_t USBHost::SetPipeAddress(uint32_t addr, uint32_t ep, EpInfo **ppep, uint
123123
/* 01-0f = non-zero HRSLT */
124124
uint32_t USBHost::ctrlReq(uint32_t addr, uint32_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi,
125125
uint16_t wInd, uint16_t total, uint32_t nbytes, uint8_t* dataptr, USBReadParser *p) {
126-
126+
127127
uint32_t direction = 0; // Request direction, IN or OUT
128128
uint32_t rcode;
129129
SETUP_PKT setup_pkt;
@@ -194,14 +194,14 @@ uint32_t USBHost::ctrlReq(uint32_t addr, uint32_t ep, uint8_t bmReqType, uint8_t
194194
((USBReadParser*)p)->Parse(read, dataptr, total - left);
195195
}
196196
else // OUT transfer
197-
{
197+
{
198198
pep->bmSndToggle = 1; //bmSNDTOG1;
199199
rcode = OutTransfer(pep, nak_limit, nbytes, dataptr);
200200
}
201201
if(rcode) //return error
202202
return (rcode);
203203
}
204-
204+
205205
// Status stage
206206
UHD_Pipe_CountZero(pep->epAddr);
207207
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
268268
}
269269
/* check for RCVDAVIRQ and generate error if not present */
270270
/* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */
271-
271+
272272
pktsize = uhd_byte_count(pep->epAddr); // Number of received bytes
273-
273+
274274
USB->HOST.HostPipe[pep->epAddr].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_BK0RDY;
275-
275+
276276
//printf("Got %i bytes \r\n", pktsize);
277277
// This would be OK, but...
278278
//assert(pktsize <= nbytes);
@@ -297,7 +297,7 @@ uint32_t USBHost::InTransfer(EpInfo *pep, uint32_t nak_limit, uint8_t *nbytesptr
297297
/* 1. The device sent a short packet (L.T. maxPacketSize) */
298298
/* 2. 'nbytes' have been transferred. */
299299
if((pktsize < maxpktsize) || (*nbytesptr >= nbytes)) // have we transferred 'nbytes' bytes?
300-
{
300+
{
301301
// Save toggle value
302302
pep->bmRcvToggle = USB_HOST_DTGL(pep->epAddr);
303303
//printf("\r\n");
@@ -505,7 +505,7 @@ void USBHost::Task(void) //USB state machine
505505
TRACE_USBHOST(printf(" + USB_DETACHED_SUBSTATE_INITIALIZE\r\n");)
506506

507507
// Init USB stack and driver
508-
UHD_Init();
508+
Init();
509509

510510
// Free all USB resources
511511
for (uint32_t i = 0; i < USB_NUMDEVICES; ++i)

libraries/USBHost/src/Usb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ e-mail : support@circuitsathome.com
2727
// None of these should ever be included by a driver, or a user's sketch.
2828

2929
#include "variant.h"
30-
#define USB_HOST_SERIAL SERIAL_PORT_MONITOR
30+
#define USB_HOST_SERIAL Serial1
3131
#include "Print.h"
3232
#include "printhex.h"
3333
#include "message.h"

0 commit comments

Comments
 (0)