Skip to content

Commit 0438323

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents b10719b + 4b9a629 commit 0438323

File tree

131 files changed

+6416
-4047
lines changed

Some content is hidden

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

131 files changed

+6416
-4047
lines changed

.github/workflows/githubci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ jobs:
4848
matrix:
4949
arduino-platform:
5050
# ESP32 ci use dev json
51+
- 'feather_esp32_v2'
5152
- 'feather_esp32s2'
5253
- 'feather_esp32s3'
54+
- 'esp32p4'
5355
# nRF52
5456
- 'cpb'
5557
- 'nrf52840'

README.md

+3-1

examples/CDC/cdc_multi/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
feather_esp32_v2
12
feather_esp32s2
23
feather_esp32s3
34
funhouse
45
magtag
56
metroesp32s2
7+
esp32p4
68
pico_rp2040_tinyusb_host

examples/CDC/cdc_multi/cdc_multi.ino

+10-6
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,27 @@
2525

2626
#include <Adafruit_TinyUSB.h>
2727

28-
#define LED LED_BUILTIN
29-
3028
// Create 2nd instance of CDC Ports.
3129
#ifdef ARDUINO_ARCH_ESP32
32-
#error "Currently multiple CDCs on ESP32-Sx is not yet supported. An PR to update core/esp32/USBCDC and/or pre-built libusb are needed."
30+
#error "Currently multiple CDCs on ESP32 is not yet supported"
3331
// for ESP32, we need to specify instance number when declaring object
3432
Adafruit_USBD_CDC USBSer1(1);
3533
#else
3634
Adafruit_USBD_CDC USBSer1;
3735
#endif
3836

3937
void setup() {
40-
pinMode(LED, OUTPUT);
38+
#ifdef LED_BUILTIN
39+
pinMode(LED_BUILTIN, OUTPUT);
40+
#endif
4141

4242
Serial.begin(115200);
4343

4444
// check to see if multiple CDCs are enabled
4545
if ( CFG_TUD_CDC < 2 ) {
46-
digitalWrite(LED, HIGH); // LED on for error indicator
46+
#ifdef LED_BUILTIN
47+
digitalWrite(LED_BUILTIN, HIGH); // LED on for error indicator
48+
#endif
4749

4850
while(1) {
4951
Serial.printf("CFG_TUD_CDC must be at least 2, current value is %u\n", CFG_TUD_CDC);
@@ -96,7 +98,9 @@ void loop() {
9698

9799
if (delay_without_delaying(500)) {
98100
LEDstate = !LEDstate;
99-
digitalWrite(LED, LEDstate);
101+
#ifdef LED_BUILTIN
102+
digitalWrite(LED_BUILTIN, LEDstate);
103+
#endif
100104
}
101105
}
102106

examples/CDC/no_serial/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/CDC/no_serial/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/CDC/no_serial/no_serial.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
* Note: this will cause device to loose the touch1200 and require
1919
* user manual interaction to put device into bootloader/DFU mode.
2020
*/
21-
22-
int led = LED_BUILTIN;
23-
24-
void setup()
25-
{
21+
void setup() {
2622
// Manual begin() is required on core without built-in support e.g. mbed rp2040
2723
if (!TinyUSBDevice.isInitialized()) {
2824
TinyUSBDevice.begin(0);
@@ -38,11 +34,12 @@ void setup()
3834
TinyUSBDevice.attach();
3935
}
4036

41-
pinMode(led, OUTPUT);
37+
#ifdef LED_BUILTIN
38+
pinMode(LED_BUILTIN, OUTPUT);
39+
#endif
4240
}
4341

44-
void loop()
45-
{
42+
void loop() {
4643
#ifdef TINYUSB_NEED_POLLING_TASK
4744
// Manual call tud_task since it isn't called by Core's background
4845
TinyUSBDevice.task();
@@ -53,6 +50,8 @@ void loop()
5350
static uint8_t led_state = 0;
5451
if (millis() - ms > 1000) {
5552
ms = millis();
53+
#ifdef LED_BUILTIN
5654
digitalWrite(LED_BUILTIN, 1-led_state);
55+
#endif
5756
}
5857
}

examples/CDC/serial_echo/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/CDC/serial_echo/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/Composite/mouse_ramdisk/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT

examples/DualRole/HID/hid_mouse_log_filter/hid_mouse_log_filter.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ uint8_t const desc_hid_report[] = {
4242
TUD_HID_REPORT_DESC_MOUSE()
4343
};
4444

45-
// USB HID object. For ESP32 these values cannot be changed after this declaration
46-
// desc report, desc len, protocol, interval, use out endpoint
45+
// USB HID object: desc report, desc len, protocol, interval, use out endpoint
4746
Adafruit_USBD_HID usb_hid(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROTOCOL_MOUSE, 2, false);
4847

4948
/* Adjustable parameters for the log_filter() method.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT

examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ uint8_t const desc_hid_report[] = {
4040
TUD_HID_REPORT_DESC_MOUSE()
4141
};
4242

43-
// USB HID object. For ESP32 these values cannot be changed after this declaration
44-
// desc report, desc len, protocol, interval, use out endpoint
43+
// USB HID object: desc report, desc len, protocol, interval, use out endpoint
4544
Adafruit_USBD_HID usb_hid(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROTOCOL_MOUSE, 2, false);
4645

4746
//------------- Low pass filter with Butterworth -------------//
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT

examples/DualRole/HID/hid_remapper/hid_remapper.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ uint8_t const desc_hid_report[] = {
4242
TUD_HID_REPORT_DESC_KEYBOARD()
4343
};
4444

45-
// USB HID object. For ESP32 these values cannot be changed after this declaration
46-
// desc report, desc len, protocol, interval, use out endpoint
45+
// USB HID object: desc report, desc len, protocol, interval, use out endpoint
4746
Adafruit_USBD_HID usb_hid(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROTOCOL_KEYBOARD, 2, false);
4847

49-
5048
void setup() {
5149
Serial.begin(115200);
5250
usb_hid.begin();

examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#endif
3939

4040
// SdFat is required for using Adafruit_USBH_MSC_SdFatDevice
41-
#include "SdFat.h"
41+
#include "SdFat_Adafruit_Fork.h"
4242

4343
// USBHost is defined in usbh_helper.h
4444
#include "usbh_helper.h"
@@ -73,7 +73,9 @@ void data_log(void) {
7373
}
7474

7575
// Turn on LED when start writing
76+
#ifdef LED_BUILTIN
7677
digitalWrite(LED_BUILTIN, HIGH);
78+
#endif
7779

7880
f_log = fatfs.open(LOG_FILE, O_WRITE | O_APPEND | O_CREAT);
7981

@@ -112,7 +114,9 @@ void usbhost_rtos_task(void *param) {
112114
void setup() {
113115
Serial.begin(115200);
114116

117+
#ifdef LED_BUILTIN
115118
pinMode(LED_BUILTIN, OUTPUT);
119+
#endif
116120

117121
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
118122
// init host stack on controller (rhport) 1
@@ -172,10 +176,12 @@ bool write_complete_callback(uint8_t dev_addr, tuh_msc_complete_data_t const *cb
172176
(void) dev_addr;
173177
(void) cb_data;
174178

179+
#ifdef LED_BUILTIN
175180
// turn off LED after write is complete
176181
// Note this only marks the usb transfer is complete, device can take longer to actual
177182
// write data to physical flash
178183
digitalWrite(LED_BUILTIN, LOW);
184+
#endif
179185

180186
return true;
181187
}

examples/DualRole/MassStorage/msc_file_explorer/msc_file_explorer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828

2929
// SdFat is required for using Adafruit_USBH_MSC_SdFatDevice
30-
#include "SdFat.h"
30+
#include "SdFat_Adafruit_Fork.h"
3131

3232
// USBHost is defined in usbh_helper.h
3333
#include "usbh_helper.h"

examples/HID/hid_boot_keyboard/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/HID/hid_boot_keyboard/hid_boot_keyboard.ino

+4
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ void setup() {
7474
}
7575

7676
// led pin
77+
#ifdef LED_BUILTIN
7778
pinMode(LED_BUILTIN, OUTPUT);
7879
digitalWrite(LED_BUILTIN, LOW);
80+
#endif
7981

8082
// overwrite input pin with PIN_BUTTONx
8183
#ifdef PIN_BUTTON1
@@ -176,6 +178,8 @@ void hid_report_callback(uint8_t report_id, hid_report_type_t report_type, uint8
176178
// Kana (4) | Compose (3) | ScrollLock (2) | CapsLock (1) | Numlock (0)
177179
uint8_t ledIndicator = buffer[0];
178180

181+
#ifdef LED_BUILTIN
179182
// turn on LED if capslock is set
180183
digitalWrite(LED_BUILTIN, ledIndicator & KEYBOARD_LED_CAPSLOCK);
184+
#endif
181185
}

examples/HID/hid_boot_mouse/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/HID/hid_boot_mouse/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/HID/hid_composite/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/HID/hid_composite/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT

examples/HID/hid_dual_interfaces/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/HID/hid_gamepad/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/HID/hid_gamepad/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/HID/hid_generic_inout/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/MIDI/midi_multi_ports/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/MIDI/midi_multi_ports/midi_multi_ports.ino

+4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
Adafruit_USBD_MIDI usb_midi(3);
2121

2222
void setup() {
23+
#ifdef LED_BUILTIN
2324
pinMode(LED_BUILTIN, OUTPUT);
25+
#endif
2426

2527
// Manual begin() is required on core without built-in support e.g. mbed rp2040
2628
if (!TinyUSBDevice.isInitialized()) {
@@ -52,6 +54,8 @@ void loop() {
5254
static uint8_t led_state = 0;
5355
if (millis() - ms > 1000) {
5456
ms = millis();
57+
#ifdef LED_BUILTIN
5558
digitalWrite(LED_BUILTIN, 1-led_state);
59+
#endif
5660
}
5761
}

examples/MIDI/midi_test/.pico_rp2040_tinyusb_host.test.skip

Whitespace-only changes.

examples/MIDI/midi_test/.skip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feather_esp32_v2
2+
pico_rp2040_tinyusb_host

examples/MIDI/midi_test/midi_test.ino

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ void setup() {
4444

4545
Serial.begin(115200);
4646

47-
pinMode(LED_BUILTIN, OUTPUT);
48-
4947
usb_midi.setStringDescriptor("TinyUSB MIDI");
5048

5149
// Initialize MIDI, and listen to all MIDI channels

examples/MassStorage/msc_esp32_file_browser/msc_esp32_file_browser.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333

3434
#include "SPI.h"
35-
#include "SdFat.h"
35+
#include "SdFat_Adafruit_Fork.h"
3636
#include "Adafruit_SPIFlash.h"
3737
#include "Adafruit_TinyUSB.h"
3838

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT
34
feather_rp2040_tinyusb

examples/MassStorage/msc_external_flash/msc_external_flash.ino

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
#include "SPI.h"
26-
#include "SdFat.h"
26+
#include "SdFat_Adafruit_Fork.h"
2727
#include "Adafruit_SPIFlash.h"
2828
#include "Adafruit_TinyUSB.h"
2929

@@ -48,9 +48,10 @@ bool fs_formatted = false;
4848
bool fs_changed = true;;
4949

5050
// the setup function runs once when you press reset or power the board
51-
void setup()
52-
{
51+
void setup() {
52+
#ifdef LED_BUILTIN
5353
pinMode(LED_BUILTIN, OUTPUT);
54+
#endif
5455

5556
Serial.begin(115200);
5657

@@ -150,7 +151,9 @@ int32_t msc_read_cb (uint32_t lba, void* buffer, uint32_t bufsize) {
150151
// Process data in buffer to disk's storage and
151152
// return number of written bytes (must be multiple of block size)
152153
int32_t msc_write_cb (uint32_t lba, uint8_t* buffer, uint32_t bufsize) {
154+
#ifdef LED_BUILTIN
153155
digitalWrite(LED_BUILTIN, HIGH);
156+
#endif
154157

155158
// Note: SPIFLash Block API: readBlocks/writeBlocks/syncBlocks
156159
// already include 4K sector caching internally. We don't need to cache it, yahhhh!!
@@ -168,5 +171,7 @@ void msc_flush_cb (void) {
168171

169172
fs_changed = true;
170173

174+
#ifdef LED_BUILTIN
171175
digitalWrite(LED_BUILTIN, LOW);
176+
#endif
172177
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
feather_esp32_v2
12
pico_rp2040_tinyusb_host
23
CH32V20x_EVT
34
feather_rp2040_tinyusb

0 commit comments

Comments
 (0)