Skip to content

Commit c63f96c

Browse files
committed
WIP trace logging tweaks
1 parent 05604e8 commit c63f96c

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

cores/arduino/USBCore.cpp

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,45 @@ USBCore_::USBCore_()
583583
void USBCore_::logEP(char kind, uint8_t ep, char dir, size_t len)
584584
{
585585
#ifdef USBCORE_TRACE
586+
usbd_ep_ram *btable_ep = (usbd_ep_ram *)(USBD_RAM + 2 * (BTABLE_OFFSET & 0xFFF8));
587+
auto rxcnt = &btable_ep[0].rx_count;
586588
Serial1.print(USBD_EPxCS(ep), 16);
587589
Serial1.print(kind);
588590
Serial1.print(ep);
589591
Serial1.print(dir);
590592
Serial1.print(len);
593+
#if 0
594+
Serial1.print(' ');
595+
Serial1.print(USBD_EPxCS(ep), 16);
596+
Serial1.print('(');
597+
Serial1.print(*rxcnt & EPRCNT_CNT);
598+
Serial1.print(')');
599+
delayMicroseconds(100);
591600
Serial1.print(' ');
592-
Serial1.println(USBD_EPxCS(ep), 16);
593-
Serial1.flush();
601+
Serial1.print(USBD_EPxCS(ep), 16);
602+
Serial1.print('(');
603+
Serial1.print(*rxcnt & EPRCNT_CNT);
604+
Serial1.print(')');
605+
delayMicroseconds(100);
606+
Serial1.print(' ');
607+
Serial1.print(USBD_EPxCS(ep), 16);
608+
Serial1.print('(');
609+
Serial1.print(*rxcnt & EPRCNT_CNT);
610+
Serial1.print(')');
611+
delayMicroseconds(100);
612+
Serial1.print(' ');
613+
Serial1.print(USBD_EPxCS(ep), 16);
614+
Serial1.print('(');
615+
Serial1.print(*rxcnt & EPRCNT_CNT);
616+
Serial1.print(')');
617+
delayMicroseconds(100);
618+
#endif
619+
Serial1.print(' ');
620+
Serial1.print(USBD_EPxCS(ep), 16);
621+
Serial1.print('(');
622+
Serial1.print(*rxcnt & EPRCNT_CNT);
623+
Serial1.println(')');
624+
// Serial1.flush();
594625
#endif
595626
}
596627

@@ -604,15 +635,15 @@ void USBCore_::hexDump(char prefix, const uint8_t *buf, size_t len)
604635
Serial1.print(' ');
605636
}
606637
Serial1.println();
607-
Serial1.flush();
638+
// Serial1.flush();
608639
#endif
609640
}
610641

611642
void USBCore_::logStatus(const char *status)
612643
{
613644
#ifdef USBCORE_TRACE
614645
Serial1.println(status);
615-
Serial1.flush();
646+
// Serial1.flush();
616647
#endif
617648
}
618649

0 commit comments

Comments
 (0)