Skip to content

Commit 788d47d

Browse files
committed
compiled with platformio
1 parent 2c8cb9e commit 788d47d

File tree

8 files changed

+47
-12
lines changed

8 files changed

+47
-12
lines changed

src/arduino/Adafruit_USBH_Host.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,18 @@ TU_ATTR_WEAK void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance,
124124
//--------------------------------------------------------------------+
125125
#if CFG_TUH_ENABLED && defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
126126

127+
#if defined(ARDUINO_ARCH_ESP32) && !defined(PLATFORMIO)
128+
extern "C" void hcd_int_handler_esp32(uint8_t rhport, bool in_isr);
129+
#endif
130+
127131
static void max3421_isr(void) {
128132
// ESP32 out-of-sync
129133
#if defined(ARDUINO_ARCH_ESP32)
130-
extern "C" void hcd_int_handler_esp32(uint8_t rhport, bool in_isr);
134+
#if defined(PLATFORMIO)
135+
tuh_int_handler(1, false);
136+
#else
131137
hcd_int_handler_esp32(1, false);
138+
#endif
132139
#else
133140
tuh_int_handler(1, true);
134141
#endif

src/class/cdc/cdc_host.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,25 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27+
// ESP32 out-of-sync
28+
#ifdef ARDUINO_ARCH_ESP32
29+
#include "arduino/ports/esp32/tusb_config_esp32.h"
30+
#endif
31+
2732
#include "tusb_option.h"
2833

2934
#if (CFG_TUH_ENABLED && CFG_TUH_CDC)
3035

3136
#include "host/usbh.h"
3237
#include "host/usbh_pvt.h"
3338

39+
// ESP32 out-of-sync
40+
#ifdef ARDUINO_ARCH_ESP32
41+
#endif
42+
3443
#include "cdc_host.h"
3544

45+
3646
// Level where CFG_TUSB_DEBUG must be at least for this driver is logged
3747
#ifndef CFG_TUH_CDC_LOG_LEVEL
3848
#define CFG_TUH_CDC_LOG_LEVEL CFG_TUH_LOG_LEVEL

src/class/dfu/dfu_device.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "tusb_option.h"
28-
29-
#if (CFG_TUD_ENABLED && CFG_TUD_DFU)
30-
3127
// ESP32 out-of-sync
3228
#ifdef ARDUINO_ARCH_ESP32
3329
#include "arduino/ports/esp32/tusb_config_esp32.h"
3430
#endif
3531

32+
#include "tusb_option.h"
33+
34+
#if (CFG_TUD_ENABLED && CFG_TUD_DFU)
35+
3636
#include "device/usbd.h"
3737
#include "device/usbd_pvt.h"
3838

src/class/hid/hid_host.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27+
// ESP32 out-of-sync
28+
#ifdef ARDUINO_ARCH_ESP32
29+
#include "arduino/ports/esp32/tusb_config_esp32.h"
30+
#endif
31+
2732
#include "tusb_option.h"
2833

2934
#if (CFG_TUH_ENABLED && CFG_TUH_HID)

src/class/msc/msc_host.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27+
// ESP32 out-of-sync
28+
#ifdef ARDUINO_ARCH_ESP32
29+
#include "arduino/ports/esp32/tusb_config_esp32.h"
30+
#endif
31+
2732
#include "tusb_option.h"
2833

2934
#if CFG_TUH_ENABLED && CFG_TUH_MSC

src/device/usbd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27+
// ESP32 out-of-sync
28+
#ifdef ARDUINO_ARCH_ESP32
29+
#include "arduino/ports/esp32/tusb_config_esp32.h"
30+
#endif
31+
2732
#include "tusb_option.h"
2833

2934
#if CFG_TUD_ENABLED
@@ -38,9 +43,7 @@
3843
//--------------------------------------------------------------------+
3944
// ESP32 out-of-sync
4045
//--------------------------------------------------------------------+
41-
#ifdef ARDUINO_ARCH_ESP32
42-
#include "arduino/ports/esp32/tusb_config_esp32.h"
43-
46+
#if defined(ARDUINO_ARCH_ESP32) && !defined(PLATFORMIO)
4447
TU_ATTR_WEAK bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size);
4548
TU_ATTR_WEAK bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
4649

src/portable/analog/max3421/hcd_max3421.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ bool hcd_setup_send(uint8_t rhport, uint8_t daddr, uint8_t const setup_packet[8]
672672
}
673673

674674
// ESP32 out-of-sync
675-
#ifdef ARDUINO_ARCH_ESP32
675+
#if defined(ARDUINO_ARCH_ESP32) && !defined(PLATFORMIO)
676676
bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr) {
677677
#else
678678
// clear stall, data toggle is also reset to DATA0
@@ -870,7 +870,7 @@ void print_hirq(uint8_t hirq) {
870870
#endif
871871

872872
// ESP32 out-of-sync
873-
#ifdef ARDUINO_ARCH_ESP32
873+
#if defined(ARDUINO_ARCH_ESP32) && !defined(PLATFORMIO)
874874
void hcd_int_handler_esp32(uint8_t rhport, bool in_isr) {
875875
#else
876876
// Interrupt handler

src/tusb_config.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@
3939
#include "arduino/ports/rp2040/tusb_config_rp2040.h"
4040

4141
#elif defined(ARDUINO_ARCH_ESP32)
42-
// For consistency: use the BSP sdk/include/arduino_tinyusb/include/tusb_config.h
43-
// Note: platformio prioritize this file over the one in BSP, include BSP one is required
42+
// Note: won't reach this if compiling with Arduino IDEs since Arduino IDE will include one
43+
// in the the BSP sdk/include/arduino_tinyusb/include/tusb_config.h
44+
45+
#if defined(PLATFORMIO)
46+
// For platformio prioritize this file over the one in BSP, include BSP one is required
47+
// For consistency: include the one in BSP
4448
#include "../../arduino_tinyusb/include/tusb_config.h"
49+
#endif
4550

4651
#else
4752
#error TinyUSB Arduino Library does not support your core yet

0 commit comments

Comments
 (0)