Skip to content

Commit

Permalink
missing \r\n after TU_LOG_BUF => moved \r\n to tu_print_buf()
Browse files Browse the repository at this point in the history
  • Loading branch information
heikokue committed Feb 8, 2024
1 parent a066002 commit 4d4e20b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions src/common/tusb_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void tu_print_mem(void const *buf, uint32_t count, uint8_t indent);

static inline void tu_print_buf(uint8_t const* buf, uint32_t bufsize) {
for(uint32_t i=0; i<bufsize; i++) tu_printf("%02X ", buf[i]);
tu_printf("\r\n");
}

// Log with Level
Expand Down
1 change: 0 additions & 1 deletion src/device/usbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr)

case DCD_EVENT_SETUP_RECEIVED:
TU_LOG_BUF(CFG_TUD_LOG_LEVEL, &event.setup_received, 8);
TU_LOG_USBD("\r\n");

// Mark as connected after receiving 1st setup packet.
// But it is easier to set it every time instead of wasting time to check then set
Expand Down
2 changes: 0 additions & 2 deletions src/host/usbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ bool tuh_control_xfer (tuh_xfer_t* xfer) {
(xfer->setup->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD && xfer->setup->bRequest <= TUSB_REQ_SYNCH_FRAME) ?
tu_str_std_request[xfer->setup->bRequest] : "Class Request");
TU_LOG_BUF_USBH(xfer->setup, 8);
TU_LOG_USBH("\r\n");

if (xfer->complete_cb) {
TU_ASSERT( hcd_setup_send(rhport, daddr, (uint8_t const*) &_ctrl_xfer.request) );
Expand Down Expand Up @@ -662,7 +661,6 @@ static bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result
if (XFER_RESULT_SUCCESS != result) {
TU_LOG_USBH("[%u:%u] Control %s, xferred_bytes = %lu\r\n", rhport, dev_addr, result == XFER_RESULT_STALLED ? "STALLED" : "FAILED", xferred_bytes);
TU_LOG_BUF_USBH(request, 8);
TU_LOG_USBH("\r\n");

// terminate transfer if any stage failed
_xfer_complete(dev_addr, result);
Expand Down

0 comments on commit 4d4e20b

Please sign in to comment.