Skip to content

Commit 3b4d46b

Browse files
authored
Merge pull request #98 from adafruit/update-tinyusb
Update tinyusb to latest with various bug fix
2 parents c7387f6 + 49647bc commit 3b4d46b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2041
-286
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ assignees: ''
1212
- Your OS (mac/windows/linux) and Arduino IDE version
1313
- Your Board and BSP version
1414
- TinyUSB library version
15+
- Sketch: If is your custom sketch, please provide a minimal sketch as attached file
1516

1617
**Describe**
1718

@@ -30,4 +31,4 @@ If applicable, add screenshots to help explain your problem.
3031

3132
**Log**
3233

33-
If applicable, provide your Serial log. If the log is too long, attach it as txt file instead.
34+
If applicable, provide your Serial log as attached txt file.

.github/workflows/githubci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
- 'cpb'
1414
- 'nrf52840'
1515
# RP2040
16-
#- 'feather_rp2040_tinyusb'
17-
#- 'pico_rp2040_tinyusb'
16+
- 'feather_rp2040_tinyusb'
1817
# SAMD
1918
- 'feather_m4_can_tinyusb'
2019
- 'metro_m0_tinyusb'

examples/Composite/mouse_external_flash/.feather_rp2040_tinyusb.test.skip

Whitespace-only changes.

examples/MassStorage/msc_external_flash/.feather_rp2040_tinyusb.test.skip

Whitespace-only changes.

examples/MassStorage/msc_external_flash_sdcard/.feather_rp2040_tinyusb.test.skip

Whitespace-only changes.

examples/MassStorage/msc_sd/.feather_rp2040_tinyusb.test.skip

Whitespace-only changes.

examples/MassStorage/msc_sdfat/.feather_rp2040_tinyusb.test.skip

Whitespace-only changes.

src/arduino/Adafruit_TinyUSB_API.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void TinyUSB_Device_FlushCDC(void) {
5555
tud_cdc_n_write_flush(instance);
5656
}
5757
}
58-
}
58+
59+
} // extern C
5960

6061
#endif

src/arduino/ports/Adafruit_TinyUSB_samd.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,17 @@ void USB_Handler(void) { tud_int_handler(0); }
5454

5555
} // extern C
5656

57-
//--------------------------------------------------------------------+
58-
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
59-
//--------------------------------------------------------------------+
60-
57+
// Debug log with Serial1
6158
#if CFG_TUSB_DEBUG
6259
extern "C" int serial1_printf(const char *__restrict format, ...) {
63-
char buf[PRINTF_BUF];
60+
char buf[256];
61+
int len;
6462
va_list ap;
6563
va_start(ap, format);
66-
vsnprintf(buf, sizeof(buf), format, ap);
64+
len = vsnprintf(buf, sizeof(buf), format, ap);
6765
Serial1.write(buf);
6866
va_end(ap);
67+
return len;
6968
}
7069
#endif
7170

@@ -127,6 +126,10 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
127126
NVIC_SetPriority((IRQn_Type)USB_IRQn, 0UL);
128127
#endif
129128

129+
#if CFG_TUSB_DEBUG
130+
Serial1.begin(115200);
131+
#endif
132+
130133
tusb_init();
131134
}
132135

src/class/audio/audio_device.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
//--------------------------------------------------------------------+
5656
// INCLUDE
5757
//--------------------------------------------------------------------+
58+
#include "device/usbd.h"
5859
#include "device/usbd_pvt.h"
60+
5961
#include "audio_device.h"
60-
//#include "common/tusb_fifo.h"
6162

6263
//--------------------------------------------------------------------+
6364
// MACRO CONSTANT TYPEDEF
@@ -548,7 +549,7 @@ static bool audiod_rx_done_cb(uint8_t rhport, audiod_function_t* audio, uint16_t
548549
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
549550
#else
550551
// Data is already placed in EP FIFO, schedule for next receive
551-
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
552+
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
552553
#endif
553554

554555
#endif
@@ -852,7 +853,7 @@ static bool audiod_tx_done_cb(uint8_t rhport, audiod_function_t * audio)
852853
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_in, audio->lin_buf_in, n_bytes_tx));
853854
#else
854855
// Send everything in ISO EP FIFO
855-
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_in, &audio->ep_in_ff, n_bytes_tx));
856+
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_in, &audio->ep_in_ff, n_bytes_tx));
856857
#endif
857858

858859
#endif
@@ -1611,7 +1612,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16111612
#if USE_LINEAR_BUFFER_RX
16121613
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
16131614
#else
1614-
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
1615+
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
16151616
#endif
16161617
}
16171618

0 commit comments

Comments
 (0)